{"_id":"612web","_rev":"2-a8ef8b638761e73a8dd681e93db09da1","name":"612web","description":"test colors 612","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"612web","version":"1.0.0","description":"test colors 612","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","_id":"612web@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"612web123","email":"769109621@qq.com"},"dist":{"integrity":"sha512-b8Gw9dCx0v54fD2Bmd+b11brifWJ8TiYkeInFawp0Z4sO03xAUqYVBPyEdQ+Au0iFaFMzi/UaoWXAFQgvStCMQ==","shasum":"675b68e3dc11f1c3ca78d9d44e04ca8e1ee0719c","tarball":"https://registry.npmjs.org/612web/-/612web-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEbHln4A8z/xFCI+LGnv9jIJeE/MvWqfsVt6HwTF+vShAiASC39lUrFYrFp5VMQIC2Ixnw85/UfIL2iVydXVrT9X4g=="}]},"maintainers":[{"name":"612web123","email":"769109621@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/612web-1.0.0.tgz_1507344298998_0.33191263512708247"}},"1.0.1":{"name":"612web","version":"1.0.1","description":"test colors 612","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","_id":"612web@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"612web123","email":"769109621@qq.com"},"dist":{"integrity":"sha512-LVuJFsxb7AK42wPu2LTp7GTJAmDMWBZtM+AHLhslAHzdyh1sIZBWqnvvA4jq6TBkGDW4EIjI4A2GzHBVH6hOOw==","shasum":"06c3ebdfc764bee376385c043470f18fdf9dfa4e","tarball":"https://registry.npmjs.org/612web/-/612web-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4R009bcU9Xtbnnm+dVxgWoHp9dwaOqkLNUEPwunuWGAiEA0c4Az8XK9ZhS3XJAQMojM8PA1Q/hcUioSAN0EAcZ0k0="}]},"maintainers":[{"name":"612web123","email":"769109621@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/612web-1.0.1.tgz_1507344446095_0.7187296224292368"}}},"readme":"![](https://raw.githubusercontent.com/Marak/colors.js/master/screenshots/colors.png)\r\nInstallation\r\n\r\nnpm install colors\r\ncolors and styles!\r\n\r\ntext colors\r\nblack\r\nred\r\ngreen\r\nyellow\r\nblue\r\nmagenta\r\ncyan\r\nwhite\r\ngray\r\ngrey\r\nbackground colors\r\nbgBlack\r\nbgRed\r\nbgGreen\r\nbgYellow\r\nbgBlue\r\nbgMagenta\r\nbgCyan\r\nbgWhite\r\nstyles\r\nreset\r\nbold\r\ndim\r\nitalic\r\nunderline\r\ninverse\r\nhidden\r\nstrikethrough\r\nextras\r\nrainbow\r\nzebra\r\namerica\r\ntrap\r\nrandom\r\nUsage\r\n\r\nBy popular demand, colors now ships with two types of usages!\r\n\r\nThe super nifty way\r\n\r\nvar colors = require('colors');\r\n\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\r\nconsole.log('Run the trap'.trap); // Drops the bass\r\n\r\nor a slightly less nifty way which doesn't extend String.prototype\r\n\r\nvar colors = require('colors/safe');\r\n\r\nconsole.log(colors.green('hello')); // outputs green text\r\nconsole.log(colors.red.underline('i like cake and pies')) // outputs red underlined text\r\nconsole.log(colors.inverse('inverse the color')); // inverses the color\r\nconsole.log(colors.rainbow('OMG Rainbows!')); // rainbow\r\nconsole.log(colors.trap('Run the trap')); // Drops the bass\r\n\r\nI prefer the first way. Some people seem to be afraid of extending String.prototype and prefer the second way.\r\n\r\nIf you are writing good code you will never have an issue with the first approach. If you really don't want to touch String.prototype, the second usage will not touch String native object.\r\n\r\nDisabling Colors\r\n\r\nTo disable colors you can pass the following arguments in the command line to your application:\r\n\r\nnode myapp.js --no-color\r\nConsole.log string substitution\r\n\r\nvar name = 'Marak';\r\nconsole.log(colors.green('Hello %s'), name);\r\n// outputs -> 'Hello Marak'\r\nCustom themes\r\n\r\nUsing standard API\r\n\r\nvar colors = require('colors');\r\n\r\ncolors.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',\r\n  debug: 'blue',\r\n  error: 'red'\r\n});\r\n\r\n// outputs red text\r\nconsole.log(\"this is an error\".error);\r\n\r\n// outputs yellow text\r\nconsole.log(\"this is a warning\".warn);\r\nUsing string safe API\r\nvar colors = require('colors/safe');\r\n\r\n// set single property\r\nvar error = colors.red;\r\nerror('this is red');\r\n\r\n// set theme\r\ncolors.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',\r\n  debug: 'blue',\r\n  error: 'red'\r\n});\r\n\r\n// outputs red text\r\nconsole.log(colors.error(\"this is an error\"));\r\n\r\n// outputs yellow text\r\nconsole.log(colors.warn(\"this is a warning\"));\r\n\r\nYou can also combine them:","maintainers":[{"name":"612web123","email":"769109621@qq.com"}],"time":{"modified":"2022-04-04T10:23:36.395Z","created":"2017-10-07T02:44:59.078Z","1.0.0":"2017-10-07T02:44:59.078Z","1.0.1":"2017-10-07T02:47:26.192Z"},"license":"ISC","readmeFilename":"README.md"}