helpers/handlebars-helper-variable

Name: handlebars-helper-variable

Owner: Helpers

Description: Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.

Created: 2015-03-19 23:13:33.0

Updated: 2015-03-21 03:58:17.0

Pushed: 2015-03-21 03:58:17.0

Homepage: null

Size: 144

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

handlebars-helper-variable NPM version Build Status

Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.

Install with npm
i handlebars-helper-variable --save
Usage
variable = require('handlebars-helper-variable');
API
variable

Dyanimcally add JSON objects to the context.

Register the helper with Handlebars

variable = require('handlebars-helper-variable');
context = {};
lebars.registerHelper('variable', variable(context));

Use the helper in a Handlebars template.

ariable "foo"}}
"foo": "bar" }
ariable}}

Compile and render the template with the given context.

lebars.compile(template)(context);
 context = { foo: { foo: 'bar' } }
Run tests

Install dev dependencies:

i -d && npm test
Contributing

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

Author

Brian Woodward

License

Copyright (c) 2015 Brian Woodward
Released under the MIT license


This file was generated by verb-cli on March 20, 2015.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.