## Compatibility This helper can be used with the following applications: - [assemble][] - [verb][] - [update][] - [generate][] - [templates][] ## Usage This helper requires the [base-questions][] plugin to be registered first. Uses the [ask-when][] library to conditionally prompt the user. See that project for available options and additional API documentation. ```js var ask = require('{%= name %}'); var questions = require('base-questions'); var templates = require('templates'); var app = templates(); app.use(questions()); // register the helper, make sure to pass `app` to the function app.asyncHelper('ask', ask(app)); ``` **Example** If you're using [templates][] directly, you'll need to create a collection and add a template engine. ```js app.create('pages'); app.engine('*', require('engine-base')); app.option('engine', '*'); ``` With the other apps you should be able to do the following: ```js var page = app.page('foo', {content: '<%= ask("name") %>'}); app.option('askWhen', 'not-answered'); app.data('name', 'Brian'); app.render(page, function(err, view) { if (err) return cb(err); console.log(view.contents.toString()); //=> 'Brian' cb(); }); ``` ## API {%= apidocs('index.js') %}