Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
helper-license
Advanced tools
Template helper for dynamically generating a basic, one-line license statement based on the given context, e.g. `Released under the MIT license`. Should work with any Handlebars, Lo-Dash, underscore, or any template engine that allows helper functions to
Template helper for dynamically generating a basic, one-line license statement based on the given context, e.g.
Released under the MIT license
. Should work with any Handlebars, Lo-Dash, underscore, or any template engine that allows helper functions to be registered.
npm i helper-license --save
Add a basic license statement to a document with verb:
{%= license() %}
//=> Released under the MIT license
{%= license({linkify: true}) %}
//=> Released under the [MIT](https://github.com/jonschlinkert/helper-license/blob/master/LICENSE-MIT) license
Add a basic license statement
var pkg = require('./package.json');
// handlebars
Handlebars.compile('{{license this}}')(pkg);
// lo-dash
_.template('<%= license({licenses: licenses}) %>', )
// verb
verb.render('{%= license({licenses: licenses}) %}', pkg);
// all result in:
//=> Released under the MIT license
Linkify:
_.template('<%= license({licenses: licenses, linkify: true}) %>', pkg);
//=> Released under the [MIT](https://github.com/jonschlinkert/helper-license/blob/master/LICENSE-MIT) license
This should work with any engine, here are a few examples to get you started
template.helper('license', require('helper-license'));
assemble.helper('license', require('helper-license'));
verb.helper('license', require('helper-license'));
var handlebars = require('handlebars');
handlebars.registerHelper('license', require('helper-license'));
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on April 23, 2015.
FAQs
Template helper for adding a formatted license statement based on the license type in package.json.
The npm package helper-license receives a total of 96 weekly downloads. As such, helper-license popularity was classified as not popular.
We found that helper-license demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.