0.4.1 • Public • Published

yeoman-easily NPM version Build Status Dependency Status Coverage percentage

This library was created to facilitate the following tasks when creating a generator with Yeoman:

  • Confirmation:
    • Can ask for confirmation before proceeding in one line. easily.confirmBeforeStart(message)
    • easily.checkForConfirmation() simply returns the result.
  • Prompting:
    • Handle storing user's input from the prompts into this.props. Just call easily.prompt(prompts) instead of the this.prompt(prompts, ...)
    • Can automatically skip prompts if an option with the same name is present. It will instead copy the value of existing this.option[field] into this.props[field].
    • Can register common prompts via easily.learnPrompts(prompts) and allow looking up prompts by name while calling easily.prompt(). This can save a lot of time if you create multiple generators that ask similar questions.
  • Composing: with another generator, either local or external
    • Simplify the syntax to easily.composeWithLocal(name, namespace, options) and easily.composeWithExternal(package, namespace, options)
  • File handling:
    • Provide functions for mass copying both static and dynamic files based on glob pattern. See easily.copyFiles(...)
    • Provide I/O functions that wraps and also resolve template and destination directory.
  • Method chaining: yeoman-easily was created with chaining in mind and support method chaining for fluent coding.


$ npm install --save yeoman-easily

Example Usage

'use strict';
var ye = require('yeoman-easily');
var Easily = ye.Easily;
var commonPrompts = ye.prompts;
var chalk = require('chalk');
module.exports = Easily.createGenerator({
  prompting: function () {
    return this.easily
      .greet('Welcome to the awesome generator!')
      .confirmBeforeStart('Would you like to use bower?')
      ], true);
  writing: function () {
    if (this.easily.checkForConfirmation()) {
        .copyFiles('**/*', {
         ignore: '**/__*',
          dynamicFiles: [
          props: props
            skipGreeting: true,
            githubAccount: this.props.githubAccount
  install: function () {

More resources


Apache-2.0 © Krist Wongsuphasawat


npm i yeoman-easily

DownloadsWeekly Downloads






Last publish


  • kristw