helpers/helper-require

Name: helper-require

Owner: Helpers

Description: Use any node module as a helper in templates. Should work with Handlebars, Lo-Dash, underscore, or any template engine that supports helper functions.

Created: 2015-02-09 04:58:58.0

Updated: 2015-02-09 04:59:19.0

Pushed: 2015-02-09 04:59:12.0

Homepage: null

Size: 108

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

helper-require NPM version Build Status

Use any node module as a helper in templates. Should work with Handlebars, Lo-Dash, underscore, or any template engine that supports helper functions.

Install with npm
i helper-require --save-dev
Usage
helper = require('helper-require');
Usage with verb

If you use a .verb.md, just add the helper to devDependencies. If you use a verbfile.js, you can register the helper like this:

.helper('require', require('helper-require'));
sage
%= require('get-value')({a: {b: {c: 'foo'}}}, 'a.b.c') %}
/=> 'foo'
Usage with assemble
mble.helper('require', require('helper-require'));
sage (pass {a: {b: {c: 'foo'}}} on the context)
{require, 'get-value' this 'a.b.c'}}
/=> 'foo'
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

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on February 08, 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.