An open API service indexing awesome lists of open source software.

https://github.com/borracciablu/banner-cli

CLI tool to add a banner comment to your files.
https://github.com/borracciablu/banner-cli

banner cli comments npm

Last synced: about 1 year ago
JSON representation

CLI tool to add a banner comment to your files.

Awesome Lists containing this project

README

          



banner-cli




CLI tool to add a comment banner to your files.


npm version
Coverage Status
Build Status
License

```

/*!
* [name] v[tag]
* [homepage]
*
* Copyright (c) [year] [author]
* [license]
*/

```

By default it will use the values in `package.json`.
All values are overridable.

If you are evaluating the use of banners please read:
- [Versioning, banners and why you may consider using it](https://adropincalm.com/blog/versioning-and-banners/)

## Installing

`npm install @borracciablu/banner-cli`

## API Reference

```
Usage: banner-cli [options] [source]

CLI tool to add a banner comment to your files.

Arguments:
source Files to bannerize

Options:
-V, --version output the version number
-n, --name override project name
-t, --tag override tag version
-s, --site override homepage
-a, --author override author
-y, --year override year
--template override template
-l, --license override license
-d, --debug debug options and args
--dry-run test the command, simulate without actually doing it
-h, --help display help for command
```

### Template feature

The `--template` option allows you to inject tags.

**The avalable tags are:**

```

:= new line. Like using \n.
[name] := project name
[tag] := project tag version
[site] := project homepage
[author] := project author
[year] := copyright year
[license] := license
[time] := unix timestamp in seconds
```

### Examples
**Basic:**

```
# add banner to each js file
$ banner-cli 'dist/**/*.js'

# add banner to each css file
# override author, license, site
$ banner-cli 'dist/**/*.css' --author 'Mr Developer' --license MIT --site https://project.js.org

# use template
$ banner-cli 'dist/**/*.css' --template '/*! v[tag] :: [time] */'
```

**Advanced:**

```
// in package.json
// inject next tag
{
"scripts" : {
"banner:patch": "NEXT_TAG=$(semver $npm_package_version -i patch) banner-cli 'dist/*.js' --template='/*! v[tag] :: [time] */' --tag=$NEXT_TAG"
}
}

```

## Notes
This package is highly inspired by [banner-cli](https://www.npmjs.com/package/banner-cli) and is currently a superset.