assemble-ask
Assemble plugin for asking questions and storing answers.
Last updated 10 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install assemble-ask 
SYNC missed versions from official npm registry.

assemble-ask NPM version

Assemble plugin for asking questions and storing answers.

Install

Install with npm

$ npm i assemble-ask --save

Usage

var assemble = require('assemble');
var ask = require('assemble-ask');

app = assemble();
app.use(ask());

app.ask('What is your name?', function(err, answer) {
  // answer => user's answer
});

Ask stored questions

app.question('name', 'What is your name?');
app.ask('name', function(err, answer) {
  // answer => user's answer
});

Automatically return saved answer

app.store.set('name', 'Jon');
app.ask('name', function(err, answer) {
  // answer => 'Jon'
});

Force re-asking a question

app.store.set('name', 'Jon');
app.ask('name', {force: true}, function(err, answer) {
  // answer => given answer
});

Helpers

Also adds an ask helper that can lookup stored questions and answers.

Example

The following will prompt the user once:

{{ask "What is your name"}}

If an answer is given by the user, it will be stored and automatically used until the user asks again on a new project or forces the question to be re-asked.

API

Related projects

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on October 21, 2015.

Current Tags

  • 0.1.4                                ...           latest (10 years ago)

4 Versions

  • 0.1.4                                ...           10 years ago
  • 0.1.3                                ...           10 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |