tooljs-optional

0.0.1 • Public • Published

tooljs-optional

Tool for conditionally executing middleware.

API

var template = require('tooljs-template');
var optional = require('tooljs-optional');
var tool = require('tooljs');

var Generator = tool('module-generator')
  .option('name', { type: 'string' })
  .option('browser', { type: 'boolean', value: false })
  .option('node', { type: 'boolean', value: true })
  .option('travis', { type: 'boolean', value: true })
  .use(optional('travis', template('.travis.yml')))
  .use(optional('browser', template('component.json')))
  .use(optional('node', template('package.json')))
  .use(template('.gitignore'))
  .use(template('Readme.md'))
  .use(template('Makefile'))
  .use(template('index.js'))
  .use(template('test.js'))
  .use(template('example.js'));

/tooljs-optional/

    Package Sidebar

    Install

    npm i tooljs-optional

    Weekly Downloads

    0

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • viatropos