{"_id":"xycolors","_rev":"2-b44cb5f84829d42b161925955f9d2d11","name":"xycolors","description":"A tiny and fast package for adding colors to your terminal output.","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"xycolors","version":"0.1.0","keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"author":{"name":"xinyao","email":"hi@xinyao.me"},"license":"MIT","_id":"xycolors@0.1.0","maintainers":[{"name":"xinyaocc","email":"hi@xinyao.me"}],"homepage":"https://github.com/xinyao27/xycolors#readme","bugs":{"url":"https://github.com/xinyao27/xycolors/issues"},"dist":{"shasum":"cf9dba9e93a5111523b0b305bf4cd90d4352fa52","tarball":"https://registry.npmjs.org/xycolors/-/xycolors-0.1.0.tgz","fileCount":8,"integrity":"sha512-UDXuo+Wza2r+aYe/bJhgrejizHZly1uHVXmyM90IGh0vrK1dG/yQ51wm/Md+kph32eoz3VW0C2gJsRcFXsofMg==","signatures":[{"sig":"MEUCIHehLCZDM2/qZvLN+mUyq1V8EZ8IjRYSIW91VrFQi1mLAiEAravI5SsDiIT9LW9u/fKAmTzr5xlERHUs6vv38Cel4e4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28874},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"funding":"https://github.com/sponsors/xinyao27","gitHead":"29dbfcdf326d9d0c86baa7bec8e0c7ff9137af10","scripts":{"up":"taze major -I","lint":"nr typecheck && eslint . --fix","stub":"unbuild --stub","test":"bun test","build":"unbuild","start":"bun run src/index.ts","prepare":"husky install","release":"release-it","benchmark":"node ./benchmark.js","typecheck":"tsc --noEmit","preinstall":"npx only-allow bun","prepublishOnly":"nr build"},"_npmUser":{"name":"xinyaocc","email":"hi@xinyao.me"},"prettier":"@xystack/style-guide/prettier","repository":{"url":"git+https://github.com/xinyao27/xycolors.git","type":"git"},"_npmVersion":"10.2.3","description":"A tiny and fast package for adding colors to your terminal output.","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"taze":"^0.13.8","chalk":"^5.3.0","husky":"^9.0.11","kleur":"^4.1.5","eslint":"^9.2.0","unbuild":"^2.0.0","prettier":"^3.2.5","@antfu/ni":"^0.21.12","cli-color":"^2.0.4","colorette":"^2.0.20","@types/bun":"^1.1.2","commitizen":"^4.3.0","nanocolors":"^0.2.13","picocolors":"^1.0.1","release-it":"^17.2.1","typescript":"^5.4.5","ansi-colors":"^4.1.3","lint-staged":"^15.2.2","@commitlint/cli":"^19.3.0","@xystack/style-guide":"^0.1.0","@jonahsnider/benchmark":"^5.0.3","cz-conventional-changelog":"^3.3.0","@release-it/conventional-changelog":"^8.0.1"},"_npmOperationalInternal":{"tmp":"tmp/xycolors_0.1.0_1715919309214_0.9600230096047031","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"xycolors","version":"0.1.1","keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"author":{"name":"xinyao","email":"hi@xinyao.me"},"license":"MIT","_id":"xycolors@0.1.1","maintainers":[{"name":"xinyaocc","email":"hi@xinyao.me"}],"homepage":"https://github.com/xinyao27/xycolors#readme","bugs":{"url":"https://github.com/xinyao27/xycolors/issues"},"dist":{"shasum":"45d85f25de537572ea1e00bee848147f0ca32f67","tarball":"https://registry.npmjs.org/xycolors/-/xycolors-0.1.1.tgz","fileCount":8,"integrity":"sha512-BbRKWpz/87nNH4lXp6TbBFUT0QipzmJI7ksQpSpBb3ny8mGJgkiKk36bIr8VqfyTEhasEBsfbp/Cum37fIHnjA==","signatures":[{"sig":"MEUCIAGISPxsavFpBWUy+oydAlDRbWC61Vz3PCwAPo+fyMbIAiEAtvNplzhci4OPdSbC1FWUPQNS7AMeC+kDhUZBTVJOBLw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":30088},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"funding":"https://github.com/sponsors/xinyao27","gitHead":"82d8f070313c037bcf85ea05e7b7095ead1d9c47","scripts":{"up":"taze major -I","lint":"nr typecheck && eslint . --fix","stub":"unbuild --stub","test":"bun test","build":"unbuild","start":"bun run src/index.ts","prepare":"husky install","release":"release-it","benchmark":"node ./benchmark.js","typecheck":"tsc --noEmit","preinstall":"npx only-allow bun","prepublishOnly":"nr build"},"_npmUser":{"name":"xinyaocc","email":"hi@xinyao.me"},"prettier":"@xystack/style-guide/prettier","repository":{"url":"git+https://github.com/xinyao27/xycolors.git","type":"git"},"_npmVersion":"10.2.3","description":"A tiny and fast package for adding colors to your terminal output.","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"taze":"^0.13.8","chalk":"^5.3.0","husky":"^9.0.11","kleur":"^4.1.5","eslint":"^9.2.0","unbuild":"^2.0.0","prettier":"^3.2.5","@antfu/ni":"^0.21.12","cli-color":"^2.0.4","colorette":"^2.0.20","@types/bun":"^1.1.2","commitizen":"^4.3.0","nanocolors":"^0.2.13","picocolors":"^1.0.1","release-it":"^17.2.1","typescript":"^5.4.5","ansi-colors":"^4.1.3","lint-staged":"^15.2.2","@commitlint/cli":"^19.3.0","@xystack/style-guide":"^0.1.0","@jonahsnider/benchmark":"^5.0.3","cz-conventional-changelog":"^3.3.0","@release-it/conventional-changelog":"^8.0.1"},"_npmOperationalInternal":{"tmp":"tmp/xycolors_0.1.1_1715919992039_0.24650525471649232","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"xycolors","version":"0.1.2","description":"A tiny and fast package for adding colors to your terminal output.","type":"module","keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"license":"MIT","homepage":"https://github.com/xinyao27/xycolors#readme","bugs":{"url":"https://github.com/xinyao27/xycolors/issues"},"repository":{"type":"git","url":"git+https://github.com/xinyao27/xycolors.git"},"author":{"name":"xinyao","email":"hi@xinyao.me"},"funding":"https://github.com/sponsors/xinyao27","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"sideEffects":false,"scripts":{"build":"unbuild","stub":"unbuild --stub","typecheck":"tsc --noEmit","lint":"nr typecheck && eslint . --fix","prepublishOnly":"nr build","release":"release-it","start":"bun run src/index.ts","test":"bun test","up":"taze major -I","prepare":"husky install","benchmark":"node ./benchmark.js"},"devDependencies":{"@antfu/ni":"^0.21.12","@commitlint/cli":"^19.3.0","@jonahsnider/benchmark":"^5.0.3","@release-it/conventional-changelog":"^8.0.1","@types/bun":"^1.1.2","@xystack/style-guide":"^0.1.0","ansi-colors":"^4.1.3","chalk":"^5.3.0","cli-color":"^2.0.4","colorette":"^2.0.20","commitizen":"^4.3.0","cz-conventional-changelog":"^3.3.0","eslint":"^9.2.0","husky":"^9.0.11","kleur":"^4.1.5","lint-staged":"^15.2.2","nanocolors":"^0.2.13","picocolors":"^1.0.1","prettier":"^3.2.5","release-it":"^17.2.1","taze":"^0.13.8","typescript":"^5.4.5","unbuild":"^2.0.0"},"prettier":"@xystack/style-guide/prettier","_id":"xycolors@0.1.2","gitHead":"687624feee38ef5a45ff1d0b49cc33773bcbbf4f","_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"integrity":"sha512-iUIDKoRUq/6Nfkiwv/PqxR6ENzgLkaaOeWwY54CtObpEwmvQHCvsgxd5xIGfEF/QU75H2quxIffOoU4tf2kKDg==","shasum":"586511f067fe1feaa5a75dc8edea39d5b529678e","tarball":"https://registry.npmjs.org/xycolors/-/xycolors-0.1.2.tgz","fileCount":8,"unpackedSize":30435,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCD/6lAjp01K0g16TsLHlLcn2O/hu7uCbenSZRFnkSpfAIgDAUtdGHrGCWUQqnYU4S7YAWc0etEmTgBXMlmi9rVeF8="}]},"_npmUser":{"name":"xinyaocc","email":"hi@xinyao.me"},"directories":{},"maintainers":[{"name":"xinyaocc","email":"hi@xinyao.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xycolors_0.1.2_1717233120146_0.6195916948108733"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-17T04:15:09.212Z","modified":"2024-06-01T09:12:00.464Z","0.1.0":"2024-05-17T04:15:09.375Z","0.1.1":"2024-05-17T04:26:32.178Z","0.1.2":"2024-06-01T09:12:00.316Z"},"maintainers":[{"name":"xinyaocc","email":"hi@xinyao.me"}],"author":{"name":"xinyao","email":"hi@xinyao.me"},"repository":{"type":"git","url":"git+https://github.com/xinyao27/xycolors.git"},"keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"license":"MIT","homepage":"https://github.com/xinyao27/xycolors#readme","bugs":{"url":"https://github.com/xinyao27/xycolors/issues"},"readme":"# xycolors 🌈\n\n[![NPM version](https://img.shields.io/npm/v/xycolors?color=a1b858&label=)](https://www.npmjs.com/package/xycolors)\n\n> A tiny and fast package for adding colors to your terminal output.\n>\n> Based on [yoctocolors](https://github.com/sindresorhus/yoctocolors)\n\n## Highlights\n\n- Tiny\n- Fast\n- Handles nested colors\n- Tree-shakeable\n- No dependencies\n- Actively maintained\n\n## Install\n\n```sh\nnpm install xycolors\n```\n\n## Usage\n\n```js\nimport * as c from 'xycolors'\n\nconsole.log(c.red('Yo!'))\n\nconsole.log(c.blue(`Welcome to the ${colors.magenta('xycolors')} package!`))\n```\n\n_This package supports [basic color detection](https://nodejs.org/api/tty.html#writestreamhascolorscount-env). Colors can be forcefully enabled by setting the `FORCE_COLOR` environment variable to `1` and can be forcefully disabled by setting `NO_COLOR` or `NODE_DISABLE_COLORS` to any value. [More info.](https://nodejs.org/api/tty.html#writestreamgetcolordepthenv)_\n\n## Styles\n\n### Modifiers\n\n- `reset` - Reset the current style.\n- `bold` - Make the text bold.\n- `dim` - Make the text have lower opacity.\n- `italic` - Make the text italic. _(Not widely supported)_\n- `underline` - Put a horizontal line above the text. _(Not widely supported)_\n- `overline` - Put a horizontal line below the text. _(Not widely supported)_\n- `inverse`- Invert background and foreground colors.\n- `hidden` - Print the text but make it invisible.\n- `strikethrough` - Put a horizontal line through the center of the text. _(Not widely supported)_\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n- `redBright`\n- `greenBright`\n- `yellowBright`\n- `blueBright`\n- `magentaBright`\n- `cyanBright`\n- `whiteBright`\n- `blackStylize`\n- `blackSecondaryStylize`\n- `redStylize`\n- `redSecondaryStylize`\n- `greenStylize`\n- `greenSecondaryStylize`\n- `yellowStylize`\n- `yellowSecondaryStylize`\n- `blueStylize`\n- `blueSecondaryStylize`\n- `magentaStylize`\n- `magentaSecondaryStylize`\n- `pinkStylize`\n- `pinkSecondaryStylize`\n- `cyanStylize`\n- `cyanSecondaryStylize`\n- `whiteStylize`\n- `whiteSecondaryStylize`\n- `grayStylize`\n- `graySecondaryStylize`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n- `bgGray`\n- `bgRedBright`\n- `bgGreenBright`\n- `bgYellowBright`\n- `bgBlueBright`\n- `bgMagentaBright`\n- `bgCyanBright`\n- `bgWhiteBright`\n\n### TrueColor\n\nYou can use the `hex` or `rgb` format.\n\nForeground function: `hex()` `rgb()`\nBackground function: `bgHex()` `bgRgb()`\n\n```ts\nimport { bgHex, bgRgb, hex, rgb } from 'xycolors'\n\n// foreground color\nhex('#E0115F')('Ruby')\nhex('#96C')('Amethyst')\nrgb(224, 17, 95)('Ruby')\n\n// background color\nbgHex('#E0115F')('Ruby')\nbgHex('#96C')('Amethyst')\nbgRgb(224, 17, 95)('Ruby')\n```\n\n## Benchmark\n\n```sh\n$ ./benchmark.js\n┌─────────┬────────────────┬─────────────┐\n│ (index) │    library     │   ops/sec   │\n├─────────┼────────────────┼─────────────┤\n│    0    │   'xycolors'   │ '8,000,000' │\n│    1    │  'picocolors'  │ '8,000,000' │\n│    2    │  'colorette'   │ '6,024,096' │\n│    3    │ 'kleur/colors' │ '4,807,692' │\n│    4    │  'nanocolors'  │ '4,807,692' │\n│    5    │    'chalk'     │ '4,000,000' │\n│    6    │    'kleur'     │ '4,000,000' │\n│    7    │ 'ansi-colors'  │ '1,848,429' │\n│    8    │  'cli-color'   │  '585,480'  │\n└─────────┴────────────────┴─────────────┘\n```\n\n_See [benchmark.js](benchmark.js)._\n\n## License\n\n[MIT](./LICENSE) License © 2024 [xinyao27](https://github.com/xinyao27)\n","readmeFilename":"README.md"}