ansi-styles
Advanced tools
Comparing version 0.1.2 to 0.2.0
'use strict'; | ||
module.exports = { | ||
reset: '\x1b[0m', | ||
bold: '\x1b[1m', | ||
italic: '\x1b[3m', | ||
underline: '\x1b[4m', | ||
blink: '\x1b[5m', | ||
inverse: '\x1b[7m', | ||
strikethrough: '\x1b[9m', | ||
reset: ['\x1b[0m', '\x1b[0m'], | ||
black: '\x1b[30m', | ||
red: '\x1b[31m', | ||
green: '\x1b[32m', | ||
yellow: '\x1b[33m', | ||
blue: '\x1b[34m', | ||
magenta: '\x1b[35m', | ||
cyan: '\x1b[36m', | ||
white: '\x1b[37m', | ||
default: '\x1b[39m', | ||
gray: '\x1B[90m', | ||
bold: ['\x1b[1m', '\x1b[22m'], | ||
italic: ['\x1b[3m', '\x1b[23m'], | ||
underline: ['\x1b[4m', '\x1b[24m'], | ||
inverse: ['\x1b[7m', '\x1b[27m'], | ||
strikethrough: ['\x1b[9m', '\x1b[29m'], | ||
bgBlack: '\x1b[40m', | ||
bgRed: '\x1b[41m', | ||
bgGreen: '\x1b[42m', | ||
bgYellow: '\x1b[43m', | ||
bgBlue: '\x1b[44m', | ||
bgMagenta: '\x1b[45m', | ||
bgCyan: '\x1b[46m', | ||
bgWhite: '\x1b[47m', | ||
bgDefault: '\x1b[49m' | ||
black: ['\x1b[30m', '\x1b[39m'], | ||
red: ['\x1b[31m', '\x1b[39m'], | ||
green: ['\x1b[32m', '\x1b[39m'], | ||
yellow: ['\x1b[33m', '\x1b[39m'], | ||
blue: ['\x1b[34m', '\x1b[39m'], | ||
magenta: ['\x1b[35m', '\x1b[39m'], | ||
cyan: ['\x1b[36m', '\x1b[39m'], | ||
white: ['\x1b[37m', '\x1b[39m'], | ||
gray: ['\x1B[90m', '\x1b[39m'], | ||
bgBlack: ['\x1b[40m', '\x1b[49m'], | ||
bgRed: ['\x1b[41m', '\x1b[49m'], | ||
bgGreen: ['\x1b[42m', '\x1b[49m'], | ||
bgYellow: ['\x1b[43m', '\x1b[49m'], | ||
bgBlue: ['\x1b[44m', '\x1b[49m'], | ||
bgMagenta: ['\x1b[45m', '\x1b[49m'], | ||
bgCyan: ['\x1b[46m', '\x1b[49m'], | ||
bgWhite: ['\x1b[47m', '\x1b[49m'] | ||
}; |
{ | ||
"name": "ansi-styles", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "ANSI escape codes for colorizing strings in the terminal", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -17,21 +17,13 @@ # ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles) | ||
Generates the above screenshot. | ||
```js | ||
var ansi = require('ansi-styles'); | ||
console.log(ansi.green + 'Styles:' + ansi.reset + '\n'); | ||
console.log(ansi.green[0] + 'Hello world!' + ansi.green[1]); | ||
``` | ||
Object.keys(ansi).forEach(function (el) { | ||
var style = ansi[el]; | ||
## API | ||
if (/^bg[^B]/.test(el)) { | ||
style = ansi.black + style; | ||
} | ||
Each style is an array of a start and end escape code. | ||
process.stdout.write(style + el + ansi.reset + ' '); | ||
}); | ||
``` | ||
## Styles | ||
@@ -45,3 +37,2 @@ | ||
- underline | ||
- blink | ||
- inverse | ||
@@ -60,3 +51,2 @@ - strikethrough | ||
- white | ||
- default | ||
- gray | ||
@@ -74,3 +64,2 @@ | ||
- bgWhite | ||
- bgDefault | ||
@@ -77,0 +66,0 @@ |
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
2830
26
66