Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
/ banr Public archive

Get one-line comment banner based on your package.json.

License

Notifications You must be signed in to change notification settings

joseluisq/banr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banr Build Status js-standard-style

Get one-line comment banner based on your package.json.

Install

Yarn

yarn add banr --dev

NPM

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