From 74cb46f70e1d168e9616ff940d1b4f6b1dc1b931 Mon Sep 17 00:00:00 2001 From: Simon Boudrias Date: Sun, 5 Mar 2017 12:20:32 +0800 Subject: [PATCH] Document legacy Generator.extend method properly - rel #996 --- lib/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index eb847b3c..fafbfd4b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -739,10 +739,16 @@ Base.prototype._writeFiles = function (done) { }; /** - * Extend this Class to create a new one inherithing this one. - * Also add a helper \_\_super__ object pointing to the parent prototypes methods + * Extend the Generator class to create a new one inherithing the base one. This + * method is useful if your environment do not suport the ES6 classes. * @param {Object} protoProps Prototype properties (available on the instances) * @param {Object} staticProps Static properties (available on the contructor) * @return {Object} New sub class + * @example + * var Generator = require('yeoman-generator'); + * module.exports = Generator.extend({ + * writing: function () {} + * // ... + * }); */ Base.extend = require('class-extend').extend;