helpers-utils

0.2.3 • Public • Published

helpers-utils NPM version

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.

Package Sidebar

Install

npm i helpers-utils

Weekly Downloads

7

Version

0.2.3

License

MIT

Last publish

Collaborators

  • doowb