ansi-style-parser
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "ansi-style-parser", | ||
"version": "1.0.0", | ||
"description": "[![build status](https://secure.travis-ci.org/smallhelm/ansi-style-parser.png)](https://travis-ci.org/smallhelm/ansi-style-parser) [![dependency status](https://david-dm.org/smallhelm/ansi-style-parser.svg)](https://david-dm.org/smallhelm/ansi-style-parser)", | ||
"version": "1.0.1", | ||
"description": "Parse ansi colors and styles", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -8,3 +8,27 @@ # ansi-style-parser | ||
```js | ||
var c = require('chalk'); | ||
var parser = require('ansi-style-parser'); | ||
var txt = 'Some '; | ||
txt += c.bold.green('styled ' + c.underline.bgBlack('text') + c.red('!')); | ||
console.log(parser(txt)); | ||
``` | ||
output: | ||
```js | ||
[ { styles: [], | ||
text: 'Some ' }, | ||
{ styles: [ 'bold', 'green' ], | ||
text: 'styled ' }, | ||
{ styles: [ 'bold', 'green', 'underline', 'bgBlack' ], | ||
text: 'text' }, | ||
{ styles: [ 'bold', 'red' ], | ||
text: '!' } ] | ||
``` | ||
## License | ||
MIT |
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
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
6451
34