diff options
author | Rebecca Turner <me@re-becca.org> | 2015-07-24 10:56:42 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-07-24 12:33:42 +0300 |
commit | 26a46535bed3a8b3e7062ceecca7e6ddb0edbd6e (patch) | |
tree | 35216d2a2d56e042c3d3cf425102477e9f2ac940 /node_modules/ansi-styles | |
parent | c71d073844d9d73b9110f4048f3a94af98dad9e8 (diff) |
ansi-styles@2.1.0
Diffstat (limited to 'node_modules/ansi-styles')
-rw-r--r-- | node_modules/ansi-styles/index.js | 111 | ||||
-rw-r--r-- | node_modules/ansi-styles/package.json | 38 | ||||
-rw-r--r-- | node_modules/ansi-styles/readme.md | 6 |
3 files changed, 82 insertions, 73 deletions
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js index caf9e119e..78945278f 100644 --- a/node_modules/ansi-styles/index.js +++ b/node_modules/ansi-styles/index.js @@ -1,56 +1,65 @@ 'use strict'; -var styles = module.exports = { - modifiers: { - reset: [0, 0], - bold: [1, 22], // 21 isn't widely supported and 22 does the same thing - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - colors: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39] - }, - bgColors: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49] - } -}; - -// fix humans -styles.colors.grey = styles.colors.gray; - -Object.keys(styles).forEach(function (groupName) { - var group = styles[groupName]; - - Object.keys(group).forEach(function (styleName) { - var style = group[styleName]; - - styles[styleName] = group[styleName] = { - open: '\u001b[' + style[0] + 'm', - close: '\u001b[' + style[1] + 'm' - }; - }); +function assembleStyles () { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; + + // fix humans + styles.colors.grey = styles.colors.gray; + + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); }); + + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles }); diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json index 25dd94d9a..98210c30f 100644 --- a/node_modules/ansi-styles/package.json +++ b/node_modules/ansi-styles/package.json @@ -1,44 +1,44 @@ { "_args": [ [ - "ansi-styles@^2.0.1", + "ansi-styles@^2.1.0", "/Users/rebecca/code/npm/node_modules/chalk" ] ], - "_from": "ansi-styles@>=2.0.1 <3.0.0", - "_id": "ansi-styles@2.0.1", + "_from": "ansi-styles@>=2.1.0 <3.0.0", + "_id": "ansi-styles@2.1.0", "_inCache": true, "_location": "/ansi-styles", - "_nodeVersion": "0.10.35", + "_nodeVersion": "0.12.4", "_npmUser": { "email": "jappelman@xebia.com", "name": "jbnicolai" }, - "_npmVersion": "2.1.16", + "_npmVersion": "2.10.1", "_phantomChildren": {}, "_requested": { "name": "ansi-styles", - "raw": "ansi-styles@^2.0.1", - "rawSpec": "^2.0.1", + "raw": "ansi-styles@^2.1.0", + "rawSpec": "^2.1.0", "scope": null, - "spec": ">=2.0.1 <3.0.0", + "spec": ">=2.1.0 <3.0.0", "type": "range" }, "_requiredBy": [ "/chalk" ], - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz", - "_shasum": "b033f57f93e2d28adeb8bc11138fa13da0fd20a3", + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", + "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", "_shrinkwrap": null, - "_spec": "ansi-styles@^2.0.1", + "_spec": "ansi-styles@^2.1.0", "_where": "/Users/rebecca/code/npm/node_modules/chalk", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", - "url": "http://sindresorhus.com" + "url": "sindresorhus.com" }, "bugs": { - "url": "https://github.com/sindresorhus/ansi-styles/issues" + "url": "https://github.com/chalk/ansi-styles/issues" }, "dependencies": {}, "description": "ANSI escape codes for styling strings in the terminal", @@ -47,8 +47,8 @@ }, "directories": {}, "dist": { - "shasum": "b033f57f93e2d28adeb8bc11138fa13da0fd20a3", - "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz" + "shasum": "990f747146927b559a932bf92959163d60c0d0e2", + "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" }, "engines": { "node": ">=0.10.0" @@ -56,8 +56,8 @@ "files": [ "index.js" ], - "gitHead": "da6541334e1681cb803f891fab8abf4313cc4bc1", - "homepage": "https://github.com/sindresorhus/ansi-styles", + "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", + "homepage": "https://github.com/chalk/ansi-styles", "keywords": [ "256", "ansi", @@ -95,10 +95,10 @@ "optionalDependencies": {}, "repository": { "type": "git", - "url": "https://github.com/sindresorhus/ansi-styles" + "url": "https://github.com/chalk/ansi-styles" }, "scripts": { "test": "mocha" }, - "version": "2.0.1" + "version": "2.1.0" } diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md index 89ec6a7c1..3f933f616 100644 --- a/node_modules/ansi-styles/readme.md +++ b/node_modules/ansi-styles/readme.md @@ -1,15 +1,15 @@ -# ansi-styles [![Build Status](https://travis-ci.org/sindresorhus/ansi-styles.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-styles) +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) > [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal -You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. ![](screenshot.png) ## Install -```sh +``` $ npm install --save ansi-styles ``` |