Socket
Socket
Sign inDemoInstall

helper-license

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    helper-license

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


Version published
Maintainers
1
Install size
6.41 kB
Created

Readme

Source

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).'
  • 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.

Keywords

FAQs

Last updated on 27 Oct 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc