New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

task-prompts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

task-prompts

User prompts for conditionally running tasks.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

task-prompts NPM version NPM downloads Build Status

User prompts for conditionally running tasks.

Install

Install with npm:

$ npm install task-prompts --save

Usage

Heads up! This is not a plugin, but the main export is a function that takes an instance of base and an options object. Requires the base-task and base-questions plugins to be registered first.

var prompts = require('task-prompts');
var questions = require('base-questions');
var task = require('base-task');
var Base = require('base');
var app = new Base();

var ask = prompts(app);
app.use(questions());
app.use(task());

Examples

Conditionally call a function

To run this example, you will also need to use the base-npm plugin.

var npm = require('base-npm');
app.use(npm());

// calls the function if the user's answer is truthy
app.task('foo', ask.confirm('Would you like to install deps?', function(cb) {
  app.npm.latest(cb);
}));

Conditionally run tasks

To run this example, you will also need to use the base-npm plugin.

// runs the specified task if the user's answer is truthy
app.task('foo', ask.confirm('Would you like to install deps?', ['npm']));

// if the user answers "yest"
app.task('npm', function(cb) {
  app.npm.latest(cb);
});

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.

This file was generated by verb, v0.9.0, on April 22, 2016.

Keywords

base

FAQs

Package last updated on 22 Apr 2016

Did you know?

Socket

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.

Install

Related posts