main.js 1013 B

1234567891011121314151617181920212223242526
  1. // Example of a simple generator.
  2. //
  3. // A raw function that is executed when this generator is resolved.
  4. //
  5. // It takes a list of arguments (usually CLI args) and a Hash of options
  6. // (CLI options), the context of the function is a `new Generator.Base`
  7. // object, which means that you can use the API as if you were extending
  8. // `Base`.
  9. //
  10. // It works with simple generator, if you need to do a bit more complex
  11. // stuff, extends from Generator.Base and defines your generator steps
  12. // in several methods.
  13. module.exports = function(args, options) {
  14. console.log('Executing generator with', args, options);
  15. };
  16. module.exports.name = 'You can name your generator';
  17. module.exports.description = 'Ana add a custom description by adding a `description` property to your function.';
  18. module.exports.usage = 'Usage can be used to customize the help output';
  19. // namespace is resolved depending on the location of this generator,
  20. // unless you specifically define it.
  21. // module.exports.namespace = 'custom-generator';