{"name":"styl3","version":"1.1.0","keywords":["colors","ansi","format","output","themes"],"author":{"name":"Tal Hayut"},"license":"MIT","_id":"styl3@1.1.0","maintainers":[{"name":"tool3","email":"talhayut.dev@gmail.com"}],"dist":{"shasum":"c9dab477543ac605b30c4ecc5730a342386f5c76","tarball":"http://registry-npm.ywwl.com/styl3/download/styl3-1.1.0.tgz","fileCount":5,"integrity":"sha512-p8nJOT+Kqs215X6bqj8XTVJki8kZLqGfq/wbqtZKuMPwiw+qmR33hUpoBACYjtmz+cSShYgu4cwjlNOQq07sjA==","signatures":[{"sig":"MEUCIQDm/Z2Wx3HpR+M17aUUzHURAfF2D5uZhy5BnuZMXaclBgIgKbpGVbfYJi/m+nyHYroHIgLyE1mIB0eSDPLzM5tj3CQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ+mpCRA9TVsSAnZWagAAiJcQAISXEm4/pmCUzwSlT78+\nGXJnTTZwv7IDI2xC7MTW0xEZvuBan+dIxGBjHvzuIZFyIiSKjHVQ8vCsI8TU\nF83FDaeSQj+Z3Dm86QlyejLW2ZZqfPcbtG8GB/Elatx5E58VNL39rfmCV431\nEwLuCOtjx6+/7kzYzoChOljPN4D9vh8kt08jOU7S1DsopjJwNy5woJQoDG7O\nMPKAwzqXCcfVSopJPnyVQVhsGIlMj4xa2ADRBzaxsGAv2WWOuhB+Xzr4n7VP\n4fpG7Va9um4wiHFjzAsutFH+g03RAWbSstebNxUBFJczZUQ9hnbHVb54X6Tc\nwz4U/LQPMez6hbZWCN8CvSbNA9OlA1mKkneHc+YWoeGiQae+J6YMlUm27q+n\nzQ0DaLtuXTKKfxz8N6bb2wGY++VmyuvIut3F1LVve3VGp10uAJ+RyOD9r+C+\nHiD7HXpruPNvHZQCg7vxGS9wQP3Mr7CQ58f+NVGn4UXxkD+ue/B9E7ro2zpT\nv09F8Btt9IO6W7QtDVD1K2Zx8Y2VEpfvvTP/NofYDM3j6+IoFep1rLo3LlUP\nP9ba/8gOtNkmVSwAIU0qg9WWgzvcjUgAwqGgcPLNMappkmfj/kKdV5rHAusT\ndr4KpZagkP27e8ekQ38IKKVR4DYXKWjR0P+lRLf/rYnjrBC3RcKNbCsLjxan\nAvM6\r\n=9NUW\r\n-----END PGP SIGNATURE-----\r\n","size":3575,"noattachment":false,"key":"/styl3/-/styl3-1.1.0.tgz"},"main":"index.js","gitHead":"60648e7eda8ae4b499df374a690440ca8c91aa5a","scripts":{"test":"mocha *.test.js","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":"7.20.3","description":"cli style manager","directories":{},"_nodeVersion":"14.15.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.0","snaptdout":"^1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/styl3_1.1.0_1630005673563_0.33320732741734727","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":1630005673692,"_cnpm_publish_time":1630005673692,"dist-tags":{"latest":"3.2.0"}}