banr
v1.0.4
Published
Get one-line comment banner based on package.json.
Downloads
7
Maintainers
Readme
Banr
Get one-line comment banner based on your package.json.
Install
yarn add banr --dev
npm install banr --save-dev
Structure
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
.
Usage
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.
Related
banr-stream - Prepend one-line package.json banner in pipeline.
License
MIT license
© 2017 José Luis Quintana