diff options
author | Quim Calpe <quim@kalpe.com> | 2013-11-23 03:31:43 +0400 |
---|---|---|
committer | Domenic Denicola <domenic@domenicdenicola.com> | 2013-11-26 10:03:45 +0400 |
commit | fd3017fc3e9d42acf6394a5285122edb4dc16106 (patch) | |
tree | 586d66bc79af12563f31a50c75cafab4d698b7fb /node_modules/ansicolors | |
parent | ec2c50f9bc926c3034ac8c5e166cdaf2c42e53e9 (diff) |
Make `npm outdated` output prettier.
Fixes #4176. Uses ansicolors, ansistyles, and text-table.
Diffstat (limited to 'node_modules/ansicolors')
-rw-r--r-- | node_modules/ansicolors/.npmignore | 15 | ||||
-rw-r--r-- | node_modules/ansicolors/.travis.yml | 4 | ||||
-rw-r--r-- | node_modules/ansicolors/LICENSE | 23 | ||||
-rw-r--r-- | node_modules/ansicolors/README.md | 62 | ||||
-rw-r--r-- | node_modules/ansicolors/ansicolors.js | 65 | ||||
-rw-r--r-- | node_modules/ansicolors/package.json | 34 | ||||
-rw-r--r-- | node_modules/ansicolors/test/ansicolors.js | 71 |
7 files changed, 274 insertions, 0 deletions
diff --git a/node_modules/ansicolors/.npmignore b/node_modules/ansicolors/.npmignore new file mode 100644 index 000000000..a72b52ebe --- /dev/null +++ b/node_modules/ansicolors/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules diff --git a/node_modules/ansicolors/.travis.yml b/node_modules/ansicolors/.travis.yml new file mode 100644 index 000000000..895dbd362 --- /dev/null +++ b/node_modules/ansicolors/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/ansicolors/LICENSE b/node_modules/ansicolors/LICENSE new file mode 100644 index 000000000..41702c504 --- /dev/null +++ b/node_modules/ansicolors/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansicolors/README.md b/node_modules/ansicolors/README.md new file mode 100644 index 000000000..f3e9d070b --- /dev/null +++ b/node_modules/ansicolors/README.md @@ -0,0 +1,62 @@ +# ansicolors [![build status](https://secure.travis-ci.org/thlorenz/ansicolors.png)](http://next.travis-ci.org/thlorenz/ansicolors) + +Functions that surround a string with ansicolor codes so it prints in color. + +In case you need styles, like `bold`, have a look at [ansistyles](https://github.com/thlorenz/ansistyles). + +## Installation + + npm install ansicolors + +## Usage + +```js +var colors = require('ansicolors'); + +// foreground colors +var redHerring = colors.red('herring'); +var blueMoon = colors.blue('moon'); +var brighBlueMoon = colors.brightBlue('moon'); + +console.log(redHerring); // this will print 'herring' in red +console.log(blueMoon); // this 'moon' in blue +console.log(brightBlueMoon); // I think you got the idea + +// background colors +console.log(colors.bgYellow('printed on yellow background')); +console.log(colors.bgBrightBlue('printed on bright blue background')); + +// mixing background and foreground colors +// below two lines have same result (order in which bg and fg are combined doesn't matter) +console.log(colors.bgYellow(colors.blue('printed on yellow background in blue'))); +console.log(colors.blue(colors.bgYellow('printed on yellow background in blue'))); +``` + +## Advanced API + +**ansicolors** allows you to access opening and closing escape sequences separately. + +```js +var colors = require('ansicolors'); + +function inspect(obj, depth) { + return require('util').inspect(obj, false, depth || 5, true); +} + +console.log('open blue', inspect(colors.open.blue)); +console.log('close bgBlack', inspect(colors.close.bgBlack)); + +// => open blue '\u001b[34m' +// close bgBlack '\u001b[49m' +``` + +## Tests + +Look at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via: + + npm explore ansicolors && npm test + +## Alternatives + +**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, +I'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js). diff --git a/node_modules/ansicolors/ansicolors.js b/node_modules/ansicolors/ansicolors.js new file mode 100644 index 000000000..16b2586f6 --- /dev/null +++ b/node_modules/ansicolors/ansicolors.js @@ -0,0 +1,65 @@ +// ColorCodes explained: http://www.termsys.demon.co.uk/vtansi.htm +'use strict'; + +var colorNums = { + white : 37 + , black : 30 + , blue : 34 + , cyan : 36 + , green : 32 + , magenta : 35 + , red : 31 + , yellow : 33 + , brightBlack : 90 + , brightRed : 91 + , brightGreen : 92 + , brightYellow : 93 + , brightBlue : 94 + , brightMagenta : 95 + , brightCyan : 96 + , brightWhite : 97 + } + , backgroundColorNums = { + bgBlack : 40 + , bgRed : 41 + , bgGreen : 42 + , bgYellow : 43 + , bgBlue : 44 + , bgMagenta : 45 + , bgCyan : 46 + , bgWhite : 47 + , bgBrightBlack : 100 + , bgBrightRed : 101 + , bgBrightGreen : 102 + , bgBrightYellow : 103 + , bgBrightBlue : 104 + , bgBrightMagenta : 105 + , bgBrightCyan : 106 + , bgBrightWhite : 107 + } + , open = {} + , close = {} + , colors = {} + ; + +Object.keys(colorNums).forEach(function (k) { + var o = open[k] = '\u001b[' + colorNums[k] + 'm'; + var c = close[k] = '\u001b[39m'; + + colors[k] = function (s) { + return o + s + c; + }; +}); + +Object.keys(backgroundColorNums).forEach(function (k) { + var o = open[k] = '\u001b[' + backgroundColorNums[k] + 'm'; + var c = close[k] = '\u001b[49m'; + + colors[k] = function (s) { + return o + s + c; + }; +}); + +module.exports = colors; +colors.open = open; +colors.close = close; diff --git a/node_modules/ansicolors/package.json b/node_modules/ansicolors/package.json new file mode 100644 index 000000000..430b2daf4 --- /dev/null +++ b/node_modules/ansicolors/package.json @@ -0,0 +1,34 @@ +{ + "name": "ansicolors", + "version": "0.3.1", + "description": "Functions that surround a string with ansicolor codes so it prints in color.", + "main": "ansicolors.js", + "scripts": { + "test": "node test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/ansicolors.git" + }, + "keywords": [ + "ansi", + "colors", + "highlight", + "string" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "license": "MIT", + "readmeFilename": "README.md", + "gitHead": "858847ca28e8b360d9b70eee0592700fa2ab087d", + "readme": "# ansicolors [![build status](https://secure.travis-ci.org/thlorenz/ansicolors.png)](http://next.travis-ci.org/thlorenz/ansicolors)\n\nFunctions that surround a string with ansicolor codes so it prints in color.\n\nIn case you need styles, like `bold`, have a look at [ansistyles](https://github.com/thlorenz/ansistyles).\n\n## Installation\n\n npm install ansicolors\n\n## Usage\n\n```js\nvar colors = require('ansicolors');\n\n// foreground colors\nvar redHerring = colors.red('herring');\nvar blueMoon = colors.blue('moon');\nvar brighBlueMoon = colors.brightBlue('moon');\n\nconsole.log(redHerring); // this will print 'herring' in red\nconsole.log(blueMoon); // this 'moon' in blue\nconsole.log(brightBlueMoon); // I think you got the idea\n\n// background colors\nconsole.log(colors.bgYellow('printed on yellow background'));\nconsole.log(colors.bgBrightBlue('printed on bright blue background'));\n\n// mixing background and foreground colors\n// below two lines have same result (order in which bg and fg are combined doesn't matter)\nconsole.log(colors.bgYellow(colors.blue('printed on yellow background in blue')));\nconsole.log(colors.blue(colors.bgYellow('printed on yellow background in blue')));\n```\n\n## Advanced API\n\n**ansicolors** allows you to access opening and closing escape sequences separately.\n\n```js\nvar colors = require('ansicolors');\n\nfunction inspect(obj, depth) {\n return require('util').inspect(obj, false, depth || 5, true);\n}\n\nconsole.log('open blue', inspect(colors.open.blue));\nconsole.log('close bgBlack', inspect(colors.close.bgBlack));\n\n// => open blue '\\u001b[34m'\n// close bgBlack '\\u001b[49m'\n```\n\n## Tests\n\nLook at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via: \n\n npm explore ansicolors && npm test\n\n## Alternatives\n\n**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, \nI'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js).\n", + "bugs": { + "url": "https://github.com/thlorenz/ansicolors/issues" + }, + "homepage": "https://github.com/thlorenz/ansicolors", + "_id": "ansicolors@0.3.1", + "_from": "ansicolors@" +} diff --git a/node_modules/ansicolors/test/ansicolors.js b/node_modules/ansicolors/test/ansicolors.js new file mode 100644 index 000000000..494539305 --- /dev/null +++ b/node_modules/ansicolors/test/ansicolors.js @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('assert') + , colors = require('..') + , open = colors.open + , close = colors.close + +console.log('Foreground colors ..'); + +assert.equal(colors.white('printed in white'), '\u001b[37mprinted in white\u001b[39m'); + +assert.equal(colors.black('printed in black'), '\u001b[30mprinted in black\u001b[39m'); +assert.equal(colors.brightBlack('printed in bright black'), '\u001b[90mprinted in bright black\u001b[39m'); + +assert.equal(colors.green('printed in green'), '\u001b[32mprinted in green\u001b[39m'); +assert.equal(colors.brightGreen('printed in bright green'), '\u001b[92mprinted in bright green\u001b[39m'); + +assert.equal(colors.red('printed in red'), '\u001b[31mprinted in red\u001b[39m'); +assert.equal(colors.brightRed('printed in bright red'), '\u001b[91mprinted in bright red\u001b[39m'); + +console.log('OK'); + +console.log('Background colors ..'); + +assert.equal( + colors.bgBlack('printed with black background') + , '\u001b[40mprinted with black background\u001b[49m' +); + +assert.equal( + colors.bgYellow('printed with yellow background') + , '\u001b[43mprinted with yellow background\u001b[49m' +); +assert.equal( + colors.bgBrightYellow('printed with bright yellow background') + , '\u001b[103mprinted with bright yellow background\u001b[49m' +); + +assert.equal( + colors.bgWhite('printed with white background') + , '\u001b[47mprinted with white background\u001b[49m' +); + +console.log('OK'); + +console.log('Mixing background and foreground colors ..'); + +assert.equal( + colors.blue(colors.bgYellow('printed in blue with yellow background')) + , '\u001b[34m\u001b[43mprinted in blue with yellow background\u001b[49m\u001b[39m' +); +assert.equal( + colors.bgYellow(colors.blue('printed in blue with yellow background again')) + , '\u001b[43m\u001b[34mprinted in blue with yellow background again\u001b[39m\u001b[49m' +); + +console.log('OK'); + +console.log('Open ...'); + +assert.equal(open.black, '\u001b[30m'); +assert.equal(open.bgYellow, '\u001b[43m'); + +console.log('OK'); + +console.log('Close ...'); + +assert.equal(close.black, '\u001b[39m'); +assert.equal(close.bgYellow, '\u001b[49m'); + +console.log('OK'); |