npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

helper-require

0.1.0

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:2
$ npm install helper-require
DailyWeeklyMonthlyYearly

helper-require NPM version Build Status

Use any node module in templates. Should work with Handlebars, Lo-Dash, underscore, or any template engine that has support for helper functions.

Install with npm

npm i helper-require --save-dev

Usage

var 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:

verb.helper('require', require('helper-require'));
// usage
// {%= require('get-value')({a: {b: {c: 'foo'}}}, 'a.b.c') %}
// //=> 'foo'

Usage with assemble

assemble.helper('require', require('helper-require'));
// usage (pass {a: {b: {c: 'foo'}}} on the context)
// {{require, 'get-value' this 'a.b.c'}}
// //=> 'foo'

Run tests

Install dev dependencies:

npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

  • github/jonschlinkert
  • twitter/jonschlinkert

License

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


This file was generated by verb on February 08, 2015.