{"name":"styl3","version":"2.2.0","keywords":["colors","ansi","format","output","themes"],"author":{"name":"Tal Hayut"},"license":"MIT","_id":"styl3@2.2.0","maintainers":[{"name":"tool3","email":"talhayut.dev@gmail.com"}],"dist":{"shasum":"e6464b7c7819eeedeef6a08403c6de325bf093bf","tarball":"http://registry-npm.ywwl.com/styl3/download/styl3-2.2.0.tgz","fileCount":22,"integrity":"sha512-xgj8/EraptlG5HZaT3lJv291lWxfDesPvC983Xv4V6oWFvgku0OKus4RGq+YrT5KwWBVLRYFM+PMySLFR6+K2Q==","signatures":[{"sig":"MEYCIQD+0V1rYCwtHXcgwLk/S2/3YpMOBdl/hej+r8J/0b8TQwIhAOVLSwHIcJ/bH8hLT7QdOCUF4D0ExIEDjZWbZhY6clBJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19003,"size":5535,"noattachment":false,"key":"/styl3/-/styl3-2.2.0.tgz"},"main":"dist/index.js","types":"dist/types/types.d.ts","gitHead":"37e86821175f0cfb633f138395fc2a227336c736","scripts":{"test":"mocha -r ts-node/register index.test.ts","build":"tsc","print":"node -e \"const keys = require('./snapshots/index.test'); Object.keys(keys).map(key => console.log(key + '\\n' + keys[key].join('\\n'))) \" "},"_npmUser":{"name":"tool3","email":"talhayut.dev@gmail.com"},"_npmVersion":"10.2.4","description":"cli style manager","directories":{},"_nodeVersion":"20.11.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.0","ts-node":"10.9.2","snaptdout":"^2.1.0","typescript":"5.4.5","@types/chai":"4.3.16","@types/node":"20.12.12","@types/mocha":"10.0.6"},"_npmOperationalInternal":{"tmp":"tmp/styl3_2.2.0_1716444232030_0.7385511329605883","host":"s3://npm-registry-packages"},"readme":"# styl3 3.2.0\n\nthemeable cli coloring\n\n# What's New\n\n✅ 20 built-in [themes](#themes)!  \n✅ Formatting [decorators](#decorators)!  \n✅ Supports custom colors and custom themes!  \n✅ Supports hex, rgb, or ansi color codes  \n✅ Color conversion utils such as rgb/hex/ansi  \n✅ Easy and flexible api\n✅ New write and timestamp options!\n\n## usage\n\n`styl3` can provide color names as functions for coloring output and decorators for adding specific formatting for a given string.  \nfor example:\n\n```typescript\nimport style from \"styl3\";\n\nconst styled = style();\n\nconst output = [\n  \"@*Never* gonna give you !up!@\",\n  \"@Never gonna %let you down%@\",\n  \"@$Never$ gonna run around and *desert* you@\"\n];\n```\n\n![](./shellfies/rick.png)\n\n```javascript\nconst style = require(\"styl3\");\nconst s = style();\n\nconsole.log(s.red`this will be a default red`);\n// access a theme specifically\nconsole.log(s.pastel.green`this will be a pastel green`);\n\nconst ss = style({ theme: \"pastel\" });\n// now `ss.green` points to the pastel green\n\nconsole.log(ss.green`also a pastel green`);\n\n// supports custom hex\nconsole.log(ss.hex(\"#de5285\")`this will be a slick pink`);\n// and rgb\nconsole.log(ss.rgb(15, 106, 251)`this will be a rich blue`);\n```\n\n![](./shellfies/themes.png)\n\n# decorators\n\ndecorators are characters used to wrap a word and give it decorating features,\nsuch as bold, italic, underline, strikeout, inverted and italic.\n\nmore than one decorator can be applied to a word\n\n## map\n\n```javascript\n{\n  bold: '*',\n  underline: '!',\n  dim: '~',\n  hidden: '#',\n  invert: '@',\n  blink: '^',\n  italic: '%',\n  strikeout: '$'\n}\n```\n\n## usage\n\n```javascript\nconst style = require(\"styl3\");\nconst s = style({ theme: \"pastel\" });\n\n// use decorators for bold, underline etc...\nconsole.log(s.red`lush red *BOLD* @INVERTED@`);\n// double decoratros\nconsole.log(s.cyan`this is !*bolderlined!*! get it? bold and underlined...😏`);\nconsole.log(s.green`viva la %italic%`);\nconsole.log(s.pink`address: ~you@somewhere.earth~`);\n```\n\n![](./shellfies/decorators.png)\n\nyou can also provide your own custom decorators map:\n\n```javascript\nconst style = require(\"styl3\");\nconst s = style({ theme: \"pastel\", decorators: { bold: \"_\" } });\n\n// use custom decorators\nconsole.log(s.red`this will now be _BOLD_`);\n```\n\nyou can also provide your own color theme:\n\n```typescript\nimport style from `styl3`;\n\nconst custom = style({\n  theme: \"custom\",\n  colors: {\n    custom: {\n      red: \"#750404\",\n      green: \"#1b7504\",\n      yellow: \"#929605\",\n      blue: \"#041382\",\n      purple: \"#620182\",\n      cyan: \"#027678\",\n      pink: \"#a3039b\",\n      orange: \"#b37202\"\n    }\n  }\n});\n\n// use custom colors\nconsole.log(s.green`this will be with #1b7504 color`);\n```\n\n# themes\n\n15 unique built-in themes to get you started on easy cli styling  \n[![](https://img.shields.io/static/v1?label=created%20with%20shellfie&message=📸&color=pink)](https://github.com/tool3/shellfie)\n\n| Theme     | Screenshot                            |\n| --------- | ------------------------------------- |\n| autumn    | ![](./shellfies/themes/autumn.png)    |\n| beach     | ![](./shellfies/themes/beach.png)     |\n| champagne | ![](./shellfies/themes/champagne.png) |\n| crayons   | ![](./shellfies/themes/crayons.png)   |\n| lush      | ![](./shellfies/themes/lush.png)      |\n| mint      | ![](./shellfies/themes/mint.png)      |\n| nature    | ![](./shellfies/themes/nature.png)    |\n| neon      | ![](./shellfies/themes/neon.png)      |\n| pastel    | ![](./shellfies/themes/pastel.png)    |\n| pinkish   | ![](./shellfies/themes/pinkish.png)   |\n| pool      | ![](./shellfies/themes/pool.png)      |\n| rainbow   | ![](./shellfies/themes/rainbow.png)   |\n| rufus     | ![](./shellfies/themes/rufus.png)     |\n| sport     | ![](./shellfies/themes/sport.png)     |\n| spring    | ![](./shellfies/themes/spring.png)    |\n| summer    | ![](./shellfies/themes/summer.png)    |\n| sunset    | ![](./shellfies/themes/sunset.png)    |\n| vintage   | ![](./shellfies/themes/vintage.png)   |\n| standard  | ![](./shellfies/themes/standard.png)  |\n| default   | ![](./shellfies/themes/default.png)   |\n\n# options\n\n`styl3` 3.2.0 introduces 2 new options for quality of life.\n\n## `write`\n\nusing this option set to true - `styl3` will perform the console.log for you.\n\n## `timestamp`\n\nusing this option `styl3` will add a timestamp to each print using the time it is printed.  \nprimarily aimed at logging use-cases.\n\n### example\n\n```typescript\nimport style from `styl3`\n\nconst styled = style({\n  write: true,\n  timestamp: {\n    format: {  dateStyle: 'short', timeStyle: 'short' },\n    color: 'blue'\n  }\n});\n\nconst a = styled.blue`this will be logged out - no need to wrap in console.log`\n// a still has the string formatted just in case you need it :)\n\nstyled.red`log is red but timestamp is blue`\n// [9/2/25, 4:49 PM] log is red but timestamp is blue\n\n```\n","publish_time":1716444232175,"_cnpm_publish_time":1716444232175,"dist-tags":{"latest":"3.2.0"}}