Get one-line comment banner based on your package.json.
yarn add banr --dev
npm install banr --save-dev
The following json keys should be defined in package.json
:
{
"name": "my-module",
"version": "1.0.0",
"license": "MIT",
"author": {
"name": "John Doe"
}
}
Note: author
value can be defined like object
or string
.
By default, Banr uses the package.json
located in your current working directory:
var banr = require('banr');
banr();
/*! MyModule v1.0.0 | MIT (c) 2017 John Doe */
Also it's possible to pass a custom package.json
path:
var banr = require('banr');
banr('./my-module-path/package.json');
/*! MyModule v2.0.0 | MIT (c) 2017 Captain Jack */
If package.json
path doesn't exist, an empty string
will be returned.
banr-stream - Prepend one-line package.json banner in pipeline.
MIT license
© 2017 José Luis Quintana