Use any node module in templates. Should work with Handlebars, Lo-Dash, underscore, or any template engine that has support for helper functions.
npm i helper-require --save-dev
var helper = require('helper-require');
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:
verb.helper('require', require('helper-require'));
// usage
// {%= require('get-value')({a: {b: {c: 'foo'}}}, 'a.b.c') %}
// //=> 'foo'
assemble.helper('require', require('helper-require'));
// usage (pass {a: {b: {c: 'foo'}}} on the context)
// {{require, 'get-value' this 'a.b.c'}}
// //=> 'foo'
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb on February 08, 2015.