How to use the yeoman-environment.util function in yeoman-environment

To help you get started, we’ve selected a few yeoman-environment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yeoman / generator / lib / actions / invoke.js View on Github external
module.exports = function invoke(namespace, options, cb) {
  cb = cb || function () {};
  options = options || {};
  options.args = options.args || [];

  // Hack: create a clone of the environment because we don't want to share
  // the runLoop
  var env = require('yeoman-environment').util.duplicateEnv(this.env);
  var generator = env.create(namespace, options);

  this.log.emit('up');
  this.log.invoke(namespace);
  this.log.emit('up');

  generator.once('end', function () {
    this.log.emit('down');
    this.log.emit('down');
  }.bind(this));

  return generator.run(cb);
};

yeoman-environment

Handles the lifecyle and bootstrapping of generators in a specific environment

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis