helper-license

0.3.0 • Public • Published

helper-license NPM version Build Status

Template helper for adding a formatted license statement based on the license type in package.json.

Install

Install with npm

$ npm i helper-license --save

Usage

var license = require('helper-license');
var pkg = require('./package');
license(pkg);
//=> 'Released under the MIT License.'

The following example shows how to register the helper with verb, but it should work similarly with handlebars, lodash or any other template engine.

var license = require('helper-license');
var verb = require('verb');
var app = verb();
 
app.helper('license', function(type) {
  // handle these settings however you want...
  return license({type: type}, {linkify: true});
});
 
// USAGE:
//  <%= license("MIT") %>

Options

options.linkify

Pass linkify: true to add a markdown link to the license file:

license(pkg, {linkify: true});
//=> 'Released under the [MIT License](./LICENSE).'

options.filepath

license(pkg, {linkify: true, filepath: 'foo'});
//=> 'Released under the [MIT License](foo).'

Related projects

  • handlebars-helpers: 120+ Handlebars helpers in ~20 categories, for Assemble, YUI, Ghost or any Handlebars project. Includes… more | homepage
  • helper-reflinks: Template helper for generating a list of markdown formatted reference links to github repos for… more | homepage
  • helper-related: Template helper for generating a list of links to the homepages of related GitHub/npm projects. | homepage
  • template-helpers: Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… more | homepage

Running 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

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on October 27, 2015.

Readme

Keywords

Package Sidebar

Install

npm i helper-license

Weekly Downloads

77

Version

0.3.0

License

MIT

Last publish

Collaborators

  • jonschlinkert