Search code examples
node.jsyeomanyeoman-generator

run yeoman from within yeoman - is it possible?


I'm writing a generator that should conditionally run another generator as a hook. Is it supported by yeoman nicely? Or am I only able to spawn OS processes that will run yeoman eventually?


Solution

  • Yeoman does support composability: http://yeoman.io/authoring/composability.html

    this.composeWith('some-name', {
      args: ['bar'],
      options: {testFramework: 'mocha'}
    }, {
      // that's the path to your npm local version
      local: require.resolve('generator-some-name')
    });