{"_id":"colour","_rev":"63239","name":"colour","description":"A cored, fixed, documented and optimized version of the popular `colors.js`: Get colors in your node.js console like what...","dist-tags":{"latest":"0.7.1"},"maintainers":[{"name":"dcode","email":""}],"time":{"modified":"2021-06-03T10:21:24.000Z","created":"2013-05-03T14:39:31.040Z","0.7.1":"2013-05-03T16:37:16.591Z","0.7.0":"2013-05-03T14:39:31.040Z"},"users":{"vitorazevedo":true,"sampsa":true},"author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/colour.js.git"},"versions":{"0.7.1":{"name":"colour","description":"A cored, fixed, documented and optimized version of the popular `colors.js`: Get colors in your node.js console like what...","version":"0.7.1","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"keywords":["ansi","terminal","colors"],"bugs":{"url":"https://github.com/dcodeIO/colour.js/issues"},"repository":{"type":"git","url":"https://github.com/dcodeIO/colour.js.git"},"engines":{"node":">=0.8"},"dependencies":{},"devDependencies":{},"main":"./colour.min.js","scripts":{"test":"node tests/test.js","compile":"ccjs colour.js --warning_level=VERBOSE --compilation_level=ADVANCED_OPTIMIZATIONS --externs=externs > colour.min.js"},"license":"MIT","readmeFilename":"README.md","_id":"colour@0.7.1","dist":{"shasum":"9cb169917ec5d12c0736d3e8685746df1cadf778","size":20156,"noattachment":false,"key":"/colour/-/colour-0.7.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/colour/download/colour-0.7.1.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":""}],"directories":{},"publish_time":1367599036591,"_hasShrinkwrap":false,"_cnpm_publish_time":1367599036591},"0.7.0":{"name":"colour","description":"A cored, fixed, documented and optimized version of the popular `colors.js`: Get colors in your node.js console like what...","version":"0.7.0","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"keywords":["ansi","terminal","colors"],"homepage":"https://github.com/dcodeIO/colour.js","bugs":{"url":"https://github.com/dcodeIO/colour.js/issues"},"repository":{"type":"git","url":"https://github.com/dcodeIO/colour.js.git"},"engines":{"node":">=0.8"},"dependencies":{},"devDependencies":{},"main":"./colour.min.js","scripts":{"test":"node tests/test.js","compile":"ccjs colour.js --warning_level=VERBOSE --compilation_level=ADVANCED_OPTIMIZATIONS --externs=externs > colour.min.js"},"license":"MIT","readmeFilename":"README.md","_id":"colour@0.7.0","dist":{"shasum":"307607e51eebb50f88646768fbff3efdb606c687","size":20189,"noattachment":false,"key":"/colour/-/colour-0.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/colour/download/colour-0.7.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":""}],"directories":{},"publish_time":1367591971040,"_hasShrinkwrap":false,"_cnpm_publish_time":1367591971040}},"readme":"![colour.js - ANSI terminal colors](https://raw.github.com/dcodeIO/colour.js/master/colour.png)\r\n===========\r\nA cored, fixed, documented and optimized version of the popular [colors.js](https://github.com/Marak/colors.js). Can be\r\nused as a drop-in replacement, also works correctly in the browser, provides a CSS mode and has been compiled through\r\nClosure Compiler using advanced optimizations. Additionally, nearly every issue and pull request on the original has\r\nbeen incorporated.\r\n\r\nInstallation\r\n------------\r\n`npm install colour`\r\n\r\nUsage\r\n-----\r\nThis package extends the global String prototype with additional getters that apply terminal colors to your texts.\r\nAvailable styles are:\r\n\r\n* **Emphasis:** bold, italic, underline, inverse\r\n* **Colors:** yellow, cyan, white, magenta, green, red, grey, blue\r\n* **Sequencers:** rainbow, zebra, random\r\n\r\n#### Example\r\n\r\n```js\r\nvar colour = require('colour');\r\nconsole.log('hello'.green); // outputs green text\r\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\r\nconsole.log('inverse the color'.inverse); // inverses the color\r\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\r\n```\r\n\r\n#### Or: As a drop-in replacement for `colors`\r\n```js\r\nvar /* just name it */ colors = require('colour');\r\n...\r\n```\r\n\r\nCustom themes\r\n-------------\r\nIts also possible to define your own themes by creating new getters on the String object. Example:\r\n\r\n```js\r\nvar colour = require('colour');\r\ncolour.setTheme({\r\n  silly: 'rainbow',\r\n  input: 'grey',\r\n  verbose: 'cyan',\r\n  prompt: 'grey',\r\n  info: 'green',\r\n  data: 'grey',\r\n  help: 'cyan',\r\n  warn: ['yellow', 'underline'], // Applies two styles at once\r\n  debug: 'blue',\r\n  error: 'red bold' // Again, two styles\r\n});\r\n\r\nconsole.log(\"this is an error\".error); // outputs bold red text\r\nconsole.log(\"this is a warning\".warn); // outputs underlined yellow text\r\n\r\nconsole.log(colour.green(\"this is green\")); // Alternatively\r\n```\r\n\r\nConsole, browser and browser-css mode\r\n-------------------------------------\r\n```js\r\nvar colour = require('colour');\r\n...\r\ncolour.mode = 'none'; // No colors at all\r\ncolour.mode = 'console'; // Adds terminal colors (default on node.js)\r\ncolour.mode = 'browser'; // Adds HTML colors (default in browsers)\r\ncolour.mode = 'browser-css'; // Adds special CSS (see examples/example.css)\r\n```\r\n\r\nUninstalling / reinstalling on the global scope\r\n-----------------------------------------------\r\nIf you have a reason to use a fresh String prototype in your application, you may also revert all extensions made.\r\n\r\n```js\r\nvar colour = require('colour');\r\n...\r\ncolour.uninstall(); // Removes all custom properties from the String prototype\r\n...\r\ncolour.install(); // Re-installs them\r\n...\r\n```\r\n\r\nMore features\r\n-------------\r\n* node.js/CommonJS compatible\r\n* RequireJS/AMD compatible\r\n* Browser/shim compatible\r\n* Closure Compiler externs included\r\n* Zero dependencies\r\n\r\nCredits\r\n-------\r\nBased on work started by Marak (Marak Squires), cloudhead (Alexis Sellier), mmalecki (Maciej Małecki), nicoreed (Nico\r\nReed), morganrallen (Morgan Allen), JustinCampbell (Justin Campbell) and ded (Dustin Diaz).\r\n\r\nLicense\r\n-------\r\nThe MIT-License (MIT)\r\n","_attachments":{},"readmeFilename":"README.md","bugs":{"url":"https://github.com/dcodeIO/colour.js/issues"},"license":"MIT"}