{"_id":"helper-ask","_rev":"227990","name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","dist-tags":{"latest":"0.2.1"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T15:44:04.000Z","created":"2016-07-01T15:36:25.311Z","0.2.1":"2016-10-01T09:57:03.138Z","0.2.0":"2016-10-01T09:54:24.937Z","0.1.4":"2016-07-14T00:57:34.907Z","0.1.3":"2016-07-13T22:56:51.411Z","0.1.2":"2016-07-11T00:59:53.197Z","0.1.1":"2016-07-01T15:36:25.311Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"versions":{"0.2.1":{"name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","version":"0.2.1","homepage":"https://github.com/helpers/helper-ask","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"bugs":{"url":"https://github.com/helpers/helper-ask/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ask-when":"^0.1.7","debug":"^2.2.0","get-value":"^2.0.6","has-value":"^0.3.1","isobject":"^2.1.0","mixin-deep":"^1.1.3"},"devDependencies":{"base-questions":"^0.7.1","engine-base":"^0.1.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.24.2"},"keywords":["answer","ask","cli","context","helper","helpers","interaction","prompt","question","render","template","templates","terminal"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["handlebars-helpers","template-helpers"]},"lint":{"reflinks":true},"reflinks":["ask-when","assemble","base-questions","generate","templates","update","verb","verb-generate-readme"]},"gitHead":"63864b5d8dd04ef1737a64cb8bf208cf80ae44f0","_id":"helper-ask@0.2.1","_shasum":"e5aca1e8d0587fc1159bbc6cf70c522537ffcf8c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"e5aca1e8d0587fc1159bbc6cf70c522537ffcf8c","size":3719,"noattachment":false,"key":"/helper-ask/-/helper-ask-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-ask/download/helper-ask-0.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/helper-ask-0.2.1.tgz_1475315821626_0.7516440919134766"},"directories":{},"publish_time":1475315823138,"_cnpm_publish_time":1475315823138,"_hasShrinkwrap":false},"0.2.0":{"name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","version":"0.2.0","homepage":"https://github.com/helpers/helper-ask","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"bugs":{"url":"https://github.com/helpers/helper-ask/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ask-when":"^0.1.4","debug":"^2.2.0","get-value":"^2.0.6","has-value":"^0.3.1","isobject":"^2.1.0","mixin-deep":"^1.1.3"},"devDependencies":{"base-questions":"^0.7.1","engine-base":"^0.1.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.24.2"},"keywords":["answer","ask","cli","context","helper","helpers","interaction","prompt","question","render","template","templates","terminal"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["handlebars-helpers","template-helpers"]},"lint":{"reflinks":true},"reflinks":["ask-when","assemble","base-questions","generate","templates","update","verb","verb-generate-readme"]},"gitHead":"72cf3e0c977235bd521fbb3236e617191d7fbaf9","_id":"helper-ask@0.2.0","_shasum":"a83ed1a4d184f113e5e5bf24925db246a6f8e7e6","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"a83ed1a4d184f113e5e5bf24925db246a6f8e7e6","size":3717,"noattachment":false,"key":"/helper-ask/-/helper-ask-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-ask/download/helper-ask-0.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/helper-ask-0.2.0.tgz_1475315663713_0.3006467467639595"},"directories":{},"publish_time":1475315664937,"_cnpm_publish_time":1475315664937,"_hasShrinkwrap":false},"0.1.4":{"name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","version":"0.1.4","homepage":"https://github.com/helpers/helper-ask","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"bugs":{"url":"https://github.com/jonschlinkert/helper-ask/issues"},"license":"MIT","files":["index.js","LICENSE"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ask-when":"^0.1.4","get-value":"^2.0.6","isobject":"^2.1.0","mixin-deep":"^1.1.3"},"devDependencies":{"base-questions":"^0.7.1","engine-base":"^0.1.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.24.2"},"keywords":["answer","ask","cli","context","helper","helpers","interaction","prompt","question","render","template","templates","terminal"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["handlebars-helpers","template-helpers"]},"lint":{"reflinks":true},"reflinks":["assemble","generate","helpers","templates","update","verb","base-questions","ask-when","verb-readme-generator"]},"gitHead":"18243fb9034fe125993142926920f36ca8670626","_id":"helper-ask@0.1.4","_shasum":"e799146e86eeff0b51328b9f00b913caf9f1441d","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"e799146e86eeff0b51328b9f00b913caf9f1441d","size":3437,"noattachment":false,"key":"/helper-ask/-/helper-ask-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-ask/download/helper-ask-0.1.4.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/helper-ask-0.1.4.tgz_1468457852882_0.35075652971863747"},"directories":{},"publish_time":1468457854907,"_cnpm_publish_time":1468457854907,"_hasShrinkwrap":false},"0.1.3":{"name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","version":"0.1.3","homepage":"https://github.com/helpers/helper-ask","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"bugs":{"url":"https://github.com/jonschlinkert/helper-ask/issues"},"license":"MIT","files":["index.js","LICENSE"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ask-when":"^0.1.1","get-value":"^2.0.6","isobject":"^2.1.0","mixin-deep":"^1.1.3"},"devDependencies":{"base-questions":"^0.6.6","engine-base":"^0.1.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.23.0"},"keywords":["answer","ask","cli","context","helper","helpers","interaction","prompt","question","render","template","templates","terminal"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["handlebars-helpers","template-helpers"]},"lint":{"reflinks":true},"reflinks":["assemble","generate","helpers","templates","update","verb","base-questions","ask-when","verb-readme-generator"]},"gitHead":"a21ba679d2e28da86b601b506f027c0d138162d6","_id":"helper-ask@0.1.3","_shasum":"fba77d152b455902330daecbdc502acde97b5dc3","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"fba77d152b455902330daecbdc502acde97b5dc3","size":3185,"noattachment":false,"key":"/helper-ask/-/helper-ask-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-ask/download/helper-ask-0.1.3.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/helper-ask-0.1.3.tgz_1468450609395_0.4662566063925624"},"directories":{},"publish_time":1468450611411,"_cnpm_publish_time":1468450611411,"_hasShrinkwrap":false},"0.1.2":{"name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","version":"0.1.2","homepage":"https://github.com/helpers/helper-ask","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"bugs":{"url":"https://github.com/jonschlinkert/helper-ask/issues"},"license":"MIT","files":["index.js","LICENSE"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ask-when":"^0.1.1","get-value":"^2.0.6","isobject":"^2.1.0","mixin-deep":"^1.1.3"},"devDependencies":{"base-questions":"^0.6.6","engine-base":"^0.1.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.23.0"},"keywords":["answer","ask","cli","context","helper","helpers","interaction","prompt","question","render","template","templates","terminal"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["handlebars-helpers","template-helpers"]},"lint":{"reflinks":true},"reflinks":["assemble","generate","helpers","templates","update","verb","base-questions","ask-when","verb-readme-generator"]},"gitHead":"4a922a8c760fe9367dd057191b8a0356d6d141b6","_id":"helper-ask@0.1.2","_shasum":"6c67a1fcf9f435dfa2934ff3d2dc355615c82b51","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"6c67a1fcf9f435dfa2934ff3d2dc355615c82b51","size":2045,"noattachment":false,"key":"/helper-ask/-/helper-ask-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-ask/download/helper-ask-0.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/helper-ask-0.1.2.tgz_1468198790481_0.4985368703491986"},"directories":{},"publish_time":1468198793197,"_cnpm_publish_time":1468198793197,"_hasShrinkwrap":false},"0.1.1":{"name":"helper-ask","description":"Async helper that prompts the user for a value and uses the answer as context for rendering the template.","version":"0.1.1","homepage":"https://github.com/helpers/helper-ask","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/helpers/helper-ask.git"},"bugs":{"url":"https://github.com/jonschlinkert/helper-ask/issues"},"license":"MIT","files":["index.js","LICENSE"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ask-when":"^0.1.1","get-value":"^2.0.6","isobject":"^2.1.0","mixin-deep":"^1.1.3"},"devDependencies":{"base-questions":"^0.6.6","engine-base":"^0.1.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.23.0"},"keywords":["answer","ask","cli","context","helper","helpers","interaction","prompt","question","render","template","templates","terminal"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["handlebars-helpers","template-helpers"]},"lint":{"reflinks":true},"reflinks":["assemble","generate","helpers","templates","update","verb","base-questions","ask-when","verb-readme-generator"]},"gitHead":"e948e1d18009fc2339af3ed7c76e055c142ca66e","_id":"helper-ask@0.1.1","_shasum":"58c6a44e5a2e477df37a061acf10de790841a9b5","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"58c6a44e5a2e477df37a061acf10de790841a9b5","size":1958,"noattachment":false,"key":"/helper-ask/-/helper-ask-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-ask/download/helper-ask-0.1.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/helper-ask-0.1.1.tgz_1467387383267_0.4114069913048297"},"directories":{},"publish_time":1467387385311,"_cnpm_publish_time":1467387385311,"_hasShrinkwrap":false}},"readme":"# helper-ask [![NPM version](https://img.shields.io/npm/v/helper-ask.svg?style=flat)](https://www.npmjs.com/package/helper-ask) [![NPM downloads](https://img.shields.io/npm/dm/helper-ask.svg?style=flat)](https://npmjs.org/package/helper-ask) [![Build Status](https://img.shields.io/travis/helpers/helper-ask.svg?style=flat)](https://travis-ci.org/helpers/helper-ask)\n\n> Async helper that prompts the user for a value and uses the answer as context for rendering the template.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save helper-ask\n```\n\n## Compatibility\n\nThis helper can be used with the following applications:\n\n* [assemble](https://github.com/assemble/assemble)\n* [verb](https://github.com/verbose/verb)\n* [update](https://github.com/update/update)\n* [generate](https://github.com/generate/generate)\n* [templates](https://github.com/jonschlinkert/templates)\n\n## Usage\n\nThis helper requires the [base-questions](https://github.com/node-base/base-questions) plugin to be registered first. Uses the [ask-when](https://github.com/jonschlinkert/ask-when) library to conditionally prompt the user. See that project for available options and additional API documentation.\n\n```js\nvar ask = require('helper-ask');\nvar questions = require('base-questions');\nvar templates = require('templates');\nvar app = templates();\n\napp.use(questions());\n\n// register the helper, make sure to pass `app` to the function\napp.asyncHelper('ask', ask(app));\n```\n\n**Example**\n\nIf you're using [templates](https://github.com/jonschlinkert/templates) directly, you'll need to create a collection and add a template engine.\n\n```js\napp.create('pages');\napp.engine('*', require('engine-base'));\napp.option('engine', '*');\n```\n\nWith the other apps you should be able to do the following:\n\n```js\nvar page = app.page('foo', {content: '<%= ask(\"name\") %>'});\napp.option('askWhen', 'not-answered');\napp.data('name', 'Brian');\n\napp.render(page, function(err, view) {\n  if (err) return cb(err);\n  console.log(view.contents.toString());\n  //=> 'Brian'\n  cb();\n});\n```\n\n## API\n\n**Params**\n\n* `app` **{Object}**\n* `returns` **{Function}**: Returns the helper function\n\n**Example**\n\n```html\n<%= ask('author.name') %>\n```\n\n## About\n\n### Related projects\n\n* [handlebars-helpers](https://www.npmjs.com/package/handlebars-helpers): More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate… [more](https://github.com/assemble/handlebars-helpers) | [homepage](https://github.com/assemble/handlebars-helpers \"More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate, Verb, Ghost, gulp-handlebars, grunt-handlebars, consolidate, or any node.js/Handlebars project.\")\n* [template-helpers](https://www.npmjs.com/package/template-helpers): Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… [more](https://github.com/jonschlinkert/template-helpers) | [homepage](https://github.com/jonschlinkert/template-helpers \"Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_\n\nTo generate the readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install -g verb verb-generate-readme && verb\n```\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/helpers/helper-ask/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 01, 2016._","_attachments":{},"homepage":"https://github.com/helpers/helper-ask","bugs":{"url":"https://github.com/helpers/helper-ask/issues"},"license":"MIT"}