question-helper
Template helper that asks a question in the command line and resolves the template with the answer.
Inspired by conversations with Jon Schlinkert
Install with npm
$ npm i question-helper --save
Usage
var question = ; // Prompt a user for a question and get an answer back.;
Params
key
{String}: Either a key on aquestions
object on the context or a question to ask.options
{String}: Additional options to pass.callback
{Function}: Callback function that will be passed an error and/or the results of asking the question.
Examples
Pass a questions
object, where the value of each property is a question to ask:
var context = questions: name: 'What is your name?' description: 'Project description?' author: name: 'Author name?' url: 'Author url?' ; // Q: 'What is your name?'; // Q: 'Project description?'; // Q: 'Author name?';
Template
To use with template:
npm i template --save
Then add to your project.
var template = ;
handebars
Register handlebars as an engine:
template; var question = ;var context = questions: name: "What's your name?"; template;template;
Lo-Dash
Register Lo-Dash as an engine:
template; var context = questions: name: "What's your name?";template; template;
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
Related
- engine-handlebars: Handlebars engine, consolidate.js style but with enhancements. This works with Assemble, express.js, engine-cache or any… more
- engine-lodash: Lo-Dash engine, consolidate.js style but with enhancements. Works with Assemble, express.js, engine-cache or any application… more
- handlebars-helpers: 120+ Handlebars helpers in ~20 categories, for Assemble, YUI, Ghost or any Handlebars project. Includes… more
- template-helpers: Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… more
- template: Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… more
Author
Brian Woodward
License
Copyright © 2015 Brian Woodward Released under the MIT license.
This file was generated by verb-cli on August 07, 2015.