Utility methods commonly used for writing helper libraries.
To install the module, run the following in the command line:
npm i helpers-utils --save
Use within your application with the following line of JavaScript:
var utils = require('helpers-utils');
Ensure that the expected API methods exist on an object.
var utils = require('helpers-utils');
var spec = {
context: function() { return {}; },
registerHelpers: function() { }
};
module.exports = function (config) {
utils.expects(config, spec);
Library.addHelper('greeting', function (userid) {
var context = config.context();
var name = context[userid] || 'Guest';
return 'Hello ' + name;
});
};
Find a bug? Have a feature request? Please create an Issue.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality,
and run docs
in the command line to build the docs with Verb.
Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!
Jon Schlinkert
Brian Woodward
Copyright (c) 2014 Brian Woodward, contributors.
Released under the MIT license
This file was generated by verb-cli on March 23, 2014.