banner-cli
Version:
Create a banner comment from package data.
105 lines (72 loc) • 3.13 kB
Markdown
<a href="https://github.com/cjpatoilo/banner-cli"><img width="100%" src="https://cjpatoilo.com/banner-cli/artwork.png" alt="BannerCLI - Create a banner comment from package data."></a>
> Create a banner comment from package data.
[](https://travis-ci.org/cjpatoilo/banner-cli?branch=master)
[](https://ci.appveyor.com/project/cjpatoilo/banner-cli)
[](https://www.codacy.com/app/cjpatoilo/banner-cli/dashboard)
[](https://david-dm.org/cjpatoilo/banner-cli)
[](https://www.npmjs.com/package/banner-cli)
[](https://www.npmjs.com/package/banner-cli)
[](https://gitter.im/cjpatoilo/banner-cli)
## Why it's awesome
A command line interface to add relevant information to your source code from package data. This lib reads the `package.json` files, then a banner is generated based on each of these values: `name`, `version`, `homepage`, `year`, `author` and `license`.
## Getting Started
**Install with npm**
```bash
$ npm install banner-cli
```
**Install with Yarn**
```bash
$ yarn add banner-cli
```
Run with npx (without installing)
```bash
$ npx banner-cli
```
_Note: Install this npm package with `-g` to global use or with `-D` to add the package as a devDependency in the `package.json` file of your project._
## Usage
_Note: Glob support is truth. Find files using the patterns the shell uses, like stars and stuff._
```bash
$ banner-cli dist/**/*.css
```
from `package.json` data:
```json
{
"name": "milligram",
"version": "1.4.0",
"homepage": "https://milligram.io",
"license": "MIT",
"author": "CJ Patoilo <cjpatoilo@gmail.com>"
}
```
to add a banner comment:
```js
/*!
* Milligram v1.4.0
* https://milligram.io
*
* Copyright (c) 2020 CJ Patoilo
* Licensed under the MIT license
*/
```
## CLI
```bash
$ banner-cli --help
Usage:
$ banner-cli <files> [<options>]
Options:
-n, --name Define project name
-t, --tag Define tag version
-s, --site Define homepage
-a, --author Define author
-y, --year Define year
-l, --license Define license
-h, --help Display help information
-v, --version Output version
Examples:
$ banner-cli dist/**/*.js
$ banner-cli dist/**/*.css --author 'CJ Patoilo' --license MIT --site https://milligram.io
```
## Contributing
Want to contribute? Follow these [recommendations](https://github.com/cjpatoilo/banner-cli/contribute).
## License
Designed with ♥ by [CJ Patoilo](https://twitter.com/cjpatoilo). Licensed under the [MIT License](https://cjpatoilo.com/license).