Search code examples
javascriptyeomanyeoman-generator

Yeoman generator naming


I can see that on the Yeoman documentation it explicitly says:

The name property must be prefixed by generator-. The keywords property must contain "yeoman-generator" and the repo must have a description to be indexed by our generators page.

However my question is, if I were developing a custom generator for private use / private npm (and therefore don't care about having it indexed) would it still matter what name I give to the generator??

Essentially, how does Yeoman figure out which npm modules are generators and which ones are not? Is it based on the module name, or the keywords? (or both)

Thanks


Solution

  • It would still matter as Yeoman (yeoman-environment) will look for NPM packages installed anywhere in your npm search path matching generator-*.

    So the name is important for yo to automatically find your generator.

    But also note that Yeoman can run generator via paths (yo ./node_modules/some-generator/app). In that case, you wouldn't need a specific name.