bannerify

v1.0.0
Add banner to your browserify bundle

bannerify

Build Status

Add banner to your browserify bundle.

Installation

$ npm install bannerify --save-dev

Usage

bannerify uses lodash templates. Inside your template you have access to data from to your package.json via pkg. moment is included for human date formatting.

Example banner.txt template file.

/**
 * @name    <%= pkg.name %>
 * @version <%= pkg.version %> | <%= moment().format('MMMM Do YYYY') %>
 * @author  <%= pkg.author %>
 * @license <%= pkg.license %>
 */

Output

/**
 * @name    bannerify
 * @version 1.0.0 | June 11th 2015
 * @author  Mirco Zeiss <[email protected]>
 * @license MIT
 */

When using uglifyjs make sure you minify with --comments to preserve comments in your minified output.

Inline template
$ browserify index.js -p [bannerify --template '/** hello world */'] > bundle.js
Template file
$ browserify index.js -p [bannerify --file ./banner.txt ] > bundle.js

Test

$ npm test

License

MIT

Metadata

  • MIT
  • Whatever
  • Mirco Zeiss
  • released 6/11/2015

Downloads

Maintainers