Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
yeoman-environment
Advanced tools
Handles the lifecyle and bootstrapping of generators in a specific environment
The yeoman-environment npm package is a robust tool for managing the lifecycle and execution of Yeoman generators. It provides a powerful API to handle the environment in which generators run, making it easier to create, run, and manage generators.
Creating a new environment
This feature allows you to create a new Yeoman environment instance. The environment is responsible for running the generators and managing their lifecycle.
const yeoman = require('yeoman-environment');
const env = yeoman.createEnv();
Registering a generator
This feature allows you to register a generator with a specific namespace. The generator can then be run using this namespace.
env.register(require.resolve('generator-name'), 'namespace');
Running a generator
This feature allows you to run a registered generator by its namespace. You can also pass options and a callback function to be executed once the generator has finished running.
env.run('namespace', options, done);
Resolving a generator
This feature allows you to resolve a generator by its namespace. This can be useful if you need to interact with the generator programmatically.
const Generator = env.get('namespace');
The yeoman-generator package provides the base class for creating Yeoman generators. While yeoman-environment focuses on managing the environment and lifecycle of generators, yeoman-generator is used to define the generators themselves.
Plop is a micro-generator framework that allows you to create and run generators. It is similar to yeoman-environment in that it helps manage the lifecycle of generators, but it is generally considered to be simpler and more lightweight.
Hygen is a code generator tool that focuses on being fast and easy to use. It provides a different approach to code generation compared to yeoman-environment, with a focus on simplicity and speed.
Handles the lifecycle and bootstrapping of generators in a specific environment
It provides a high-level API to discover, create and run generators, as well as further tuning of where and how a generator is resolved.
$ npm install --save yeoman-environment
Full documentation available at http://yeoman.io/authoring/integrating-yeoman.html
var yeoman = require('yeoman-environment');
var env = yeoman.createEnv();
// The #lookup() method will search the user computer for installed generators.
// The search if done from the current working directory.
env.lookup(function () {
env.run('angular', {'skip-install': true}, function (err) {
console.log('done');
});
});
For advance usage, see our API documentation.
BSD © Yeoman
FAQs
Handles the lifecyle and bootstrapping of generators in a specific environment
The npm package yeoman-environment receives a total of 895,356 weekly downloads. As such, yeoman-environment popularity was classified as popular.
We found that yeoman-environment demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.