{"_id":"@colors/colors@1.6.1","bugs":{"url":"https://github.com/DABH/colors.js/issues"},"dist":{"shasum":"8e2827259ada76965b3a051c18a5927fbdac38c2","tarball":"http://registry-npm.ywwl.com/@colors/colors/download/@colors/colors-1.6.1.tgz","fileCount":22,"integrity":"sha512-dTmUJzXSuayBK+hZydEaXd2mhx61qWQwkwaBBY6LyEOVx/L9aQU5ac8eFNEsd9nrD1+zb9zvDCphLSe8g1F4Qw==","signatures":[{"sig":"MEQCIHhcJjkfWSGKTkwbn8Yy3M2ZpeR+HiCphsnHXFTN/Yg3AiBkWIsThOerPD03llrUqGcdOSbha2dmQnua+3AXfPFMhg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnB7bvgXm9TqxtYtKa0Eoal0Q+GOLex0e63T8H/1ZwVwIhAJH7dztR5wPX+wm6uJi35q8FqtkPN5HmSVCVTnbI+W7J"}],"unpackedSize":42319,"size":11773,"noattachment":false,"key":"/@colors/colors/-/@colors/colors-1.6.1.tgz"},"main":"lib/index.js","name":"@colors/colors","_from":"file:artifacts/releases/colors-colors-1.6.1.tgz","author":{"name":"DABH"},"engines":{"node":">=0.1.90"},"license":"MIT","scripts":{"lint":"eslint . --fix","test":"export FORCE_COLOR=1 && node tests/basic-test.js && node tests/safe-test.js","test:types":"tsc --noEmit"},"version":"1.6.1","_npmUser":{"name":"dabh","email":"dabh@alumni.stanford.edu"},"homepage":"https://github.com/DABH/colors.js","keywords":["ansi","terminal","colors"],"_resolved":"/Users/dabh/dabh_llc/artifacts/releases/colors-colors-1.6.1.tgz","_integrity":"sha512-dTmUJzXSuayBK+hZydEaXd2mhx61qWQwkwaBBY6LyEOVx/L9aQU5ac8eFNEsd9nrD1+zb9zvDCphLSe8g1F4Qw==","repository":{"url":"git+ssh://git@github.com/DABH/colors.js.git","type":"git"},"_npmVersion":"11.9.0","description":"get colors in your node.js console","directories":{},"maintainers":[{"name":"dabh","email":"dabh@alumni.stanford.edu"}],"_nodeVersion":"24.14.0","contributors":[{"url":"https://github.com/DABH","name":"DABH"}],"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.9.0","typescript":"5.7.3","eslint-config-google":"^0.14.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/colors_1.6.1_1788753087590_0.9145585239300784"},"readme":"# @colors/colors (\"colors.js\")\n\n## Distribution and maintenance\n\n**DABH** — Distributed and maintained by [DABH LLC](https://dabh.llc/).\nFor maintenance and software consulting inquiries: [hello@dabh.llc](mailto:hello@dabh.llc).\n\nThis distribution builds on the original colors.js library by Marak Squires and\nadditional functionality by Sindre Sorhus and DABH. Original copyright notices\nand the MIT license are preserved in [LICENSE](LICENSE).\n\n[![Build Status](https://github.com/DABH/colors.js/actions/workflows/ci.yml/badge.svg)](https://github.com/DABH/colors.js/actions/workflows/ci.yml)\n[![version](https://img.shields.io/npm/v/@colors/colors.svg)](https://www.npmjs.org/package/@colors/colors)\n\nPlease check out the [roadmap](ROADMAP.md) for upcoming features and releases.  Please open Issues to provide feedback.\n\n## get color and style in your node.js console\n\n![Demo](https://raw.githubusercontent.com/DABH/colors.js/master/screenshots/colors.png)\n\n## Installation\n\n    npm install @colors/colors\n\n## colors and styles!\n\n### text colors\n\n  - black\n  - red\n  - green\n  - yellow\n  - blue\n  - magenta\n  - cyan\n  - white\n  - gray\n  - grey\n\n### bright text colors\n\n  - brightRed\n  - brightGreen\n  - brightYellow\n  - brightBlue\n  - brightMagenta\n  - brightCyan\n  - brightWhite\n\n### background colors\n\n  - bgBlack\n  - bgRed\n  - bgGreen\n  - bgYellow\n  - bgBlue\n  - bgMagenta\n  - bgCyan\n  - bgWhite\n  - bgGray\n  - bgGrey\n\n### bright background colors\n\n  - bgBrightRed\n  - bgBrightGreen\n  - bgBrightYellow\n  - bgBrightBlue\n  - bgBrightMagenta\n  - bgBrightCyan\n  - bgBrightWhite\n\n### styles\n\n  - reset\n  - bold\n  - dim\n  - italic\n  - underline\n  - inverse\n  - hidden\n  - strikethrough\n\n### extras\n\n  - rainbow\n  - zebra\n  - america\n  - trap\n  - random\n\n\n## Usage\n\nBy popular demand, `@colors/colors` now ships with two types of usages!\n\nThe super nifty way\n\n```js\nvar colors = require('@colors/colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red); // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow\nconsole.log('Run the trap'.trap); // Drops the bass\n\n```\n\nor a slightly less nifty way which doesn't extend `String.prototype`\n\n```js\nvar colors = require('@colors/colors/safe');\n\nconsole.log(colors.green('hello')); // outputs green text\nconsole.log(colors.red.underline('i like cake and pies')); // outputs red underlined text\nconsole.log(colors.inverse('inverse the color')); // inverses the color\nconsole.log(colors.rainbow('OMG Rainbows!')); // rainbow\nconsole.log(colors.trap('Run the trap')); // Drops the bass\n\n```\n\nI prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way. \n\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.\n\n## Enabling/Disabling Colors\n\nThe package will auto-detect whether your terminal can use colors and enable/disable accordingly. When colors are disabled, the color functions do nothing. You can override this with a command-line flag:\n\n```bash\nnode myapp.js --no-color\nnode myapp.js --color=false\n\nnode myapp.js --color\nnode myapp.js --color=true\nnode myapp.js --color=always\n\nFORCE_COLOR=1 node myapp.js\n```\n\nOr in code:\n\n```javascript\nvar colors = require('@colors/colors');\ncolors.enable();\ncolors.disable();\n```\n\n## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)\n\n```js\nvar name = 'Beowulf';\nconsole.log(colors.green('Hello %s'), name);\n// outputs -> 'Hello Beowulf'\n```\n\n## Custom themes\n\n### Using standard API\n\n```js\n\nvar colors = require('@colors/colors');\n\ncolors.setTheme({\n  silly: 'rainbow',\n  input: 'grey',\n  verbose: 'cyan',\n  prompt: 'grey',\n  info: 'green',\n  data: 'grey',\n  help: 'cyan',\n  warn: 'yellow',\n  debug: 'blue',\n  error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n### Using string safe API\n\n```js\nvar colors = require('@colors/colors/safe');\n\n// set single property\nvar error = colors.red;\nerror('this is red');\n\n// set theme\ncolors.setTheme({\n  silly: 'rainbow',\n  input: 'grey',\n  verbose: 'cyan',\n  prompt: 'grey',\n  info: 'green',\n  data: 'grey',\n  help: 'cyan',\n  warn: 'yellow',\n  debug: 'blue',\n  error: 'red'\n});\n\n// outputs red text\nconsole.log(colors.error(\"this is an error\"));\n\n// outputs yellow text\nconsole.log(colors.warn(\"this is a warning\"));\n\n```\n\n### Combining Colors\n\n```javascript\nvar colors = require('@colors/colors');\n\ncolors.setTheme({\n  custom: ['red', 'underline']\n});\n\nconsole.log('test'.custom);\n```\n\n*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*\n","publish_time":1788753087681,"_cnpm_publish_time":1788753087681,"dist-tags":{"latest":"1.6.1"}}