ansi-colors
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "ansi-colors", | ||
"description": "Collection of ansi colors and styles.", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/doowb/ansi-colors", | ||
@@ -49,38 +49,24 @@ "author": "Brian Woodward (https://github.com/doowb)", | ||
"ansi-yellow": "^0.1.1", | ||
"lazy-cache": "^0.2.4" | ||
"lazy-cache": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
"gulp-format-md": "^0.1.9", | ||
"mocha": "^2.5.3" | ||
}, | ||
"verb": { | ||
"related": { | ||
"list": [ | ||
"ansi-bgblack", | ||
"ansi-bgblue", | ||
"ansi-bgcyan", | ||
"ansi-bggreen", | ||
"ansi-bgmagenta", | ||
"ansi-bgred", | ||
"ansi-bgwhite", | ||
"ansi-bgyellow", | ||
"ansi-black", | ||
"ansi-blue", | ||
"ansi-bold", | ||
"ansi-cyan", | ||
"ansi-dim", | ||
"ansi-gray", | ||
"ansi-green", | ||
"ansi-grey", | ||
"ansi-hidden", | ||
"ansi-inverse", | ||
"ansi-italic", | ||
"ansi-magenta", | ||
"ansi-red", | ||
"ansi-reset", | ||
"ansi-strikethrough", | ||
"ansi-underline", | ||
"ansi-white", | ||
"ansi-yellow" | ||
] | ||
} | ||
"toc": false, | ||
"layout": "default", | ||
"tasks": [ | ||
"readme" | ||
], | ||
"plugins": [ | ||
"gulp-format-md" | ||
], | ||
"lint": { | ||
"reflinks": true | ||
}, | ||
"reflinks": [ | ||
"verb-readme-generator", | ||
"verb" | ||
] | ||
}, | ||
@@ -87,0 +73,0 @@ "keywords": [ |
480
README.md
@@ -1,466 +0,94 @@ | ||
# ansi-colors [![NPM version](https://badge.fury.io/js/ansi-colors.svg)](http://badge.fury.io/js/ansi-colors) | ||
# ansi-colors [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat)](https://travis-ci.org/doowb/ansi-colors) | ||
> Collection of ansi colors and styles. | ||
Collection of ansi colors and styles. | ||
## Install | ||
Install with [npm](https://www.npmjs.com/) | ||
Install with [npm](https://www.npmjs.com/): | ||
```sh | ||
$ npm i ansi-colors --save | ||
$ npm install --save ansi-colors | ||
``` | ||
## Usage | ||
This module was created to make it easy to allow color configuration through options. | ||
```js | ||
var colors = require('ansi-colors'); | ||
``` | ||
If your application will always one or two specific colors, we recommend directly requiring only [the necessary modules](#related-projects). | ||
## API | ||
If your application uses **more than 10 colors**, we recommend using [chalk](https://github.com/chalk/chalk) for faster require times (since chalk loads everything at once). However, when using less than 10 colors this module will be more efficient due to lazy caching the [underlying modules](#related-projects). | ||
### [bgblack](index.js#L47) | ||
## Usage | ||
Wrap a string with ansi codes to create a black background. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bgblack('some string')); | ||
var colors = require('ansi-colors'); | ||
``` | ||
### [bgblue](index.js#L62) | ||
## About | ||
Wrap a string with ansi codes to create a blue background. | ||
### Related projects | ||
**Params** | ||
You might also be interested in these projects: | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
* [ansi-bgblack](https://www.npmjs.com/package/ansi-bgblack): The color bgblack, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgblack "The color bgblack, in ansi.") | ||
* [ansi-bgblue](https://www.npmjs.com/package/ansi-bgblue): The color bgblue, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgblue "The color bgblue, in ansi.") | ||
* [ansi-bgcyan](https://www.npmjs.com/package/ansi-bgcyan): The color bgcyan, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgcyan "The color bgcyan, in ansi.") | ||
* [ansi-bggreen](https://www.npmjs.com/package/ansi-bggreen): The color bggreen, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bggreen "The color bggreen, in ansi.") | ||
* [ansi-bgmagenta](https://www.npmjs.com/package/ansi-bgmagenta): The color bgmagenta, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgmagenta "The color bgmagenta, in ansi.") | ||
* [ansi-bgred](https://www.npmjs.com/package/ansi-bgred): The color bgred, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgred "The color bgred, in ansi.") | ||
* [ansi-bgwhite](https://www.npmjs.com/package/ansi-bgwhite): The color bgwhite, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgwhite "The color bgwhite, in ansi.") | ||
* [ansi-bgyellow](https://www.npmjs.com/package/ansi-bgyellow): The color bgyellow, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgyellow "The color bgyellow, in ansi.") | ||
* [ansi-black](https://www.npmjs.com/package/ansi-black): The color black, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-black "The color black, in ansi.") | ||
* [ansi-blue](https://www.npmjs.com/package/ansi-blue): The color blue, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-blue "The color blue, in ansi.") | ||
* [ansi-bold](https://www.npmjs.com/package/ansi-bold): The color bold, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bold "The color bold, in ansi.") | ||
* [ansi-cyan](https://www.npmjs.com/package/ansi-cyan): The color cyan, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-cyan "The color cyan, in ansi.") | ||
* [ansi-dim](https://www.npmjs.com/package/ansi-dim): The color dim, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-dim "The color dim, in ansi.") | ||
* [ansi-gray](https://www.npmjs.com/package/ansi-gray): The color gray, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-gray "The color gray, in ansi.") | ||
* [ansi-green](https://www.npmjs.com/package/ansi-green): The color green, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-green "The color green, in ansi.") | ||
* [ansi-grey](https://www.npmjs.com/package/ansi-grey): The color grey, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-grey "The color grey, in ansi.") | ||
* [ansi-hidden](https://www.npmjs.com/package/ansi-hidden): The color hidden, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-hidden "The color hidden, in ansi.") | ||
* [ansi-inverse](https://www.npmjs.com/package/ansi-inverse): The color inverse, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-inverse "The color inverse, in ansi.") | ||
* [ansi-italic](https://www.npmjs.com/package/ansi-italic): The color italic, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-italic "The color italic, in ansi.") | ||
* [ansi-magenta](https://www.npmjs.com/package/ansi-magenta): The color magenta, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-magenta "The color magenta, in ansi.") | ||
* [ansi-red](https://www.npmjs.com/package/ansi-red): The color red, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-red "The color red, in ansi.") | ||
* [ansi-reset](https://www.npmjs.com/package/ansi-reset): The color reset, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-reset "The color reset, in ansi.") | ||
* [ansi-strikethrough](https://www.npmjs.com/package/ansi-strikethrough): The color strikethrough, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-strikethrough "The color strikethrough, in ansi.") | ||
* [ansi-underline](https://www.npmjs.com/package/ansi-underline): The color underline, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-underline "The color underline, in ansi.") | ||
* [ansi-white](https://www.npmjs.com/package/ansi-white): The color white, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-white "The color white, in ansi.") | ||
* [ansi-yellow](https://www.npmjs.com/package/ansi-yellow): The color yellow, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-yellow "The color yellow, in ansi.") | ||
**Example** | ||
### Contributing | ||
```js | ||
console.log(colors.bgblue('some string')); | ||
``` | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). | ||
### [bgcyan](index.js#L77) | ||
### Building docs | ||
Wrap a string with ansi codes to create a cyan background. | ||
_(This document was generated by [verb-readme-generator](https://github.com/verbose/verb-readme-generator) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ | ||
**Params** | ||
Generate readme and API documentation with [verb](https://github.com/verbose/verb): | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bgcyan('some string')); | ||
```sh | ||
$ npm install -g verb verb-readme-generator && verb | ||
``` | ||
### [bggreen](index.js#L92) | ||
### Running tests | ||
Wrap a string with ansi codes to create a green background. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bggreen('some string')); | ||
``` | ||
### [bgmagenta](index.js#L107) | ||
Wrap a string with ansi codes to create a magenta background. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bgmagenta('some string')); | ||
``` | ||
### [bgred](index.js#L122) | ||
Wrap a string with ansi codes to create a red background. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bgred('some string')); | ||
``` | ||
### [bgwhite](index.js#L137) | ||
Wrap a string with ansi codes to create a white background. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bgwhite('some string')); | ||
``` | ||
### [bgyellow](index.js#L152) | ||
Wrap a string with ansi codes to create a yellow background. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bgyellow('some string')); | ||
``` | ||
### [black](index.js#L167) | ||
Wrap a string with ansi codes to create black text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.black('some string')); | ||
``` | ||
### [blue](index.js#L182) | ||
Wrap a string with ansi codes to create blue text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.blue('some string')); | ||
``` | ||
### [bold](index.js#L197) | ||
Wrap a string with ansi codes to create bold text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.bold('some string')); | ||
``` | ||
### [cyan](index.js#L212) | ||
Wrap a string with ansi codes to create cyan text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.cyan('some string')); | ||
``` | ||
### [dim](index.js#L227) | ||
Wrap a string with ansi codes to create dim text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.dim('some string')); | ||
``` | ||
### [gray](index.js#L242) | ||
Wrap a string with ansi codes to create gray text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.gray('some string')); | ||
``` | ||
### [green](index.js#L257) | ||
Wrap a string with ansi codes to create green text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.green('some string')); | ||
``` | ||
### [grey](index.js#L272) | ||
Wrap a string with ansi codes to create grey text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.grey('some string')); | ||
``` | ||
### [hidden](index.js#L287) | ||
Wrap a string with ansi codes to create hidden text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.hidden('some string')); | ||
``` | ||
### [inverse](index.js#L302) | ||
Wrap a string with ansi codes to create inverse text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.inverse('some string')); | ||
``` | ||
### [italic](index.js#L317) | ||
Wrap a string with ansi codes to create italic text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.italic('some string')); | ||
``` | ||
### [magenta](index.js#L332) | ||
Wrap a string with ansi codes to create magenta text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.magenta('some string')); | ||
``` | ||
### [red](index.js#L347) | ||
Wrap a string with ansi codes to create red text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.red('some string')); | ||
``` | ||
### [reset](index.js#L362) | ||
Wrap a string with ansi codes to reset ansi colors currently on the string. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.reset('some string')); | ||
``` | ||
### [strikethrough](index.js#L377) | ||
Wrap a string with ansi codes to add a strikethrough to the text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.strikethrough('some string')); | ||
``` | ||
### [underline](index.js#L392) | ||
Wrap a string with ansi codes to underline the text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.underline('some string')); | ||
``` | ||
### [white](index.js#L407) | ||
Wrap a string with ansi codes to create white text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.white('some string')); | ||
``` | ||
### [yellow](index.js#L422) | ||
Wrap a string with ansi codes to create yellow text. | ||
**Params** | ||
* `str` **{String}**: String to wrap with ansi codes. | ||
* `returns` **{String}**: Wrapped string | ||
**Example** | ||
```js | ||
console.log(colors.yellow('some string')); | ||
``` | ||
## Related projects | ||
* [ansi-bgblack](https://www.npmjs.com/package/ansi-bgblack): The color bgblack, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgblack) | ||
* [ansi-bgblue](https://www.npmjs.com/package/ansi-bgblue): The color bgblue, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgblue) | ||
* [ansi-bgcyan](https://www.npmjs.com/package/ansi-bgcyan): The color bgcyan, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgcyan) | ||
* [ansi-bggreen](https://www.npmjs.com/package/ansi-bggreen): The color bggreen, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bggreen) | ||
* [ansi-bgmagenta](https://www.npmjs.com/package/ansi-bgmagenta): The color bgmagenta, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgmagenta) | ||
* [ansi-bgred](https://www.npmjs.com/package/ansi-bgred): The color bgred, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgred) | ||
* [ansi-bgwhite](https://www.npmjs.com/package/ansi-bgwhite): The color bgwhite, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgwhite) | ||
* [ansi-bgyellow](https://www.npmjs.com/package/ansi-bgyellow): The color bgyellow, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgyellow) | ||
* [ansi-black](https://www.npmjs.com/package/ansi-black): The color black, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-black) | ||
* [ansi-blue](https://www.npmjs.com/package/ansi-blue): The color blue, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-blue) | ||
* [ansi-bold](https://www.npmjs.com/package/ansi-bold): The color bold, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bold) | ||
* [ansi-cyan](https://www.npmjs.com/package/ansi-cyan): The color cyan, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-cyan) | ||
* [ansi-dim](https://www.npmjs.com/package/ansi-dim): The color dim, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-dim) | ||
* [ansi-gray](https://www.npmjs.com/package/ansi-gray): The color gray, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-gray) | ||
* [ansi-green](https://www.npmjs.com/package/ansi-green): The color green, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-green) | ||
* [ansi-grey](https://www.npmjs.com/package/ansi-grey): The color grey, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-grey) | ||
* [ansi-hidden](https://www.npmjs.com/package/ansi-hidden): The color hidden, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-hidden) | ||
* [ansi-inverse](https://www.npmjs.com/package/ansi-inverse): The color inverse, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-inverse) | ||
* [ansi-italic](https://www.npmjs.com/package/ansi-italic): The color italic, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-italic) | ||
* [ansi-magenta](https://www.npmjs.com/package/ansi-magenta): The color magenta, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-magenta) | ||
* [ansi-red](https://www.npmjs.com/package/ansi-red): The color red, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-red) | ||
* [ansi-reset](https://www.npmjs.com/package/ansi-reset): The color reset, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-reset) | ||
* [ansi-strikethrough](https://www.npmjs.com/package/ansi-strikethrough): The color strikethrough, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-strikethrough) | ||
* [ansi-underline](https://www.npmjs.com/package/ansi-underline): The color underline, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-underline) | ||
* [ansi-white](https://www.npmjs.com/package/ansi-white): The color white, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-white) | ||
* [ansi-yellow](https://www.npmjs.com/package/ansi-yellow): The color yellow, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-yellow) | ||
## Running tests | ||
Install dev dependencies: | ||
```sh | ||
$ npm i -d && npm test | ||
$ npm install -d && npm test | ||
``` | ||
## Contributing | ||
### Author | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/ansi-colors/issues/new). | ||
## Author | ||
**Brian Woodward** | ||
+ [github/doowb](https://github.com/doowb) | ||
+ [twitter/doowb](http://twitter.com/doowb) | ||
* [github/doowb](https://github.com/doowb) | ||
* [twitter/doowb](http://twitter.com/doowb) | ||
## License | ||
### License | ||
Copyright © 2015 Brian Woodward | ||
Released under the MIT license. | ||
Copyright © 2016, [Brian Woodward](https://github.com/doowb). | ||
Released under the [MIT license](https://github.com/doowb/ansi-colors/blob/master/LICENSE). | ||
*** | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 30, 2015._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 11, 2016._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18884
2
94
1
+ Addedis-buffer@1.1.6(transitive)
+ Addedkind-of@3.2.2(transitive)
+ Addedlazy-cache@2.0.2(transitive)
+ Addedset-getter@0.1.1(transitive)
+ Addedto-object-path@0.3.0(transitive)
- Removedlazy-cache@0.2.7(transitive)
Updatedlazy-cache@^2.0.1