helpers-utils
v0.2.3
Published
Utility methods commonly used for writing helper libraries.
Downloads
43
Maintainers
Readme
helpers-utils
Utility methods commonly used for writing helper libraries.
Getting Started
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');
Usage
expects
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;
});
};
Contributing
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!
Author
Jon Schlinkert
Brian Woodward
License
Copyright (c) 2014 Brian Woodward, contributors.
Released under the MIT license
This file was generated by verb-cli on March 23, 2014.