Adds header / banner info to a file. Nice to use as npm script :)
npm install -g headr
(it may require Root privileges)
or for npm script:
npm install --save-dev headr
- Node.js 4+
$ headr input.js -o=output.js --version --homepage --license
Headr will inspect package.json using name and description as default, and then generates the following code:
/**
* headr - Add header to a file
*
* @version v0.0.1
* @homepage http://heldr.com
* @license MIT
*/
your code
$ headr input.js -o=output.js --homepage="link"
/**
* headr - Add header to a file
*
* @link http://heldr.com
*/
your code
$ headr input.js -o=output.js --h-tab-spaces=4
$ cat input.js | headr -o=output.js --version --homepage --license
or:
$ cat input.js | headr --version --homepage --license > output.js
Just make sure to use a different output file in this case, otherwise -o
replaces the file nicely :)
MIT License (c) Helder Santana