# helper-license [![NPM version](https://badge.fury.io/js/helper-license.svg)](http://badge.fury.io/js/helper-license)  [![Build Status](https://travis-ci.org/helpers/helper-license.svg)](https://travis-ci.org/helpers/helper-license)

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

## Install

Install with [npm](https://www.npmjs.com/)

```sh
$ npm i helper-license --save
```

## Usage

```js
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](https://github.com/verbose/verb), but it should work similarly with handlebars, lodash or any other template engine.

```js
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:

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

**options.filepath**

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

## Related projects

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

## Running tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/helpers/helper-license/issues/new).

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2015 Jon Schlinkert
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 27, 2015._

<!-- reflinks -->