{"name":"tfunk","version":"4.0.0","description":"Multi-colour console output from chalk with added awesome","repository":{"type":"git","url":"git+https://github.com/shakyShane/tfunk.git"},"keywords":["color","colour","colors","terminal","console","cli","string","styles","formatting","rgb","shell","xterm","log","logging","command-line","text"],"scripts":{"lint":"jshint test/*.js index.js","test":"npm run lint && mocha"},"author":{"name":"Shane Osbourne"},"license":"MIT","dependencies":{"chalk":"^1.1.3","dlv":"^1.1.3"},"devDependencies":{"chai":"^1.10.0","jshint":"^2.6.0","mocha":"^8.2.0","pegjs":"^0.8.0"},"gitHead":"bbb3dcd7c20436c88a139a4f93a79c4d214e8be5","bugs":{"url":"https://github.com/shakyShane/tfunk/issues"},"homepage":"https://github.com/shakyShane/tfunk#readme","_id":"tfunk@4.0.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-eJQ0dGfDIzWNiFNYFVjJ+Ezl/GmwHaFTBTjrtqNPW0S7cuVDBrZrmzUz6VkMeCR4DZFqhd4YtLwsw3i2wYHswQ==","shasum":"de9399feaf2060901d590b7faad80fcd5443077e","tarball":"http://registry-npm.ywwl.com/tfunk/download/tfunk-4.0.0.tgz","fileCount":4,"unpackedSize":32273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiz7iCRA9TVsSAnZWagAAZn8P/AnWQifNCx9JCnHAJXEq\n82Oo/hs5mHzqr/ycxQG8qfRFHvi6gH8UApADOKDnb0xvg/sibtZv0D/n1ySF\nmKlwCtxAVUxcwYHtQ4Xo1xD3YELKWyhHW2cgcCFgbSQIfRhn3+ghnTBOJ83O\n9M9TmcW3m+fu1sklwO3hmtrgUIwsi3P3xNFgFSahqcVIEpk4k6V72bX+Vh6h\n7RVy68jl7jI5urijk6OHrwexCXoJKRdmh/Zl+neIQ9iYeqBjcoOK01DYTumd\npw0QshT3RjG8ly5q2IfwEkLqUDN8AtPutaoMnsfpAbGwfbzE8snmEe+y2zOx\ndjYt4OVFY7J1XEFiUVjQQ9wE3D+BmuaxHISqZGpOZem29VqY/yj5PT27sj70\nlgIjoBcbESnA/2fuPmjbozL4sd3ZKtyxz9gdaBM7kNfW5LPunW7zrjF8mbpa\nXO2Hnovy7Sc4pKT/s3PU8uH/ieZNKYaP5vZ9Zi8k06RDXrBzJwm16t3yfJaO\nobinFwo6n02UhStnmRIjqYYb3yVZLlS3fUhDgOjUmWJ0tXCORD4E0Hw2ioCS\n5NRZ7mYraA4TwWAZ/wKmPdpyBPYX3R4MsX5qicYOAMCsb1FPoBWSTjuOF6Qs\nDiJQKkBRhR88dUzCM6781nenMBJhvmJvKSFRydkLOJOusRNropgQWr4YSFC3\n9OWI\r\n=Dina\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErLuy7vX8dkrobiEEGUZjlLI8rJfTFUNByEmeXGC5H5AiEAxvw/LQP4L2LQAPraio9YXgqsndMc3Fev7G05omZqPdI="}],"size":6616,"noattachment":false,"key":"/tfunk/-/tfunk-4.0.0.tgz"},"maintainers":[{"name":"shakyshane","email":"shakyshane@gmail.com"}],"_npmUser":{"name":"shakyshane","email":"shakyshane@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tfunk_4.0.0_1602961121591_0.43355603041719104"},"_hasShrinkwrap":false,"readme":"##tfunk [![Build Status](https://travis-ci.org/shakyShane/tfunk.svg)](https://travis-ci.org/shakyShane/tfunk)\n\nMulti-colour console output from [Chalk](https://github.com/sindresorhus/chalk#styles) with added awesome.\n\nby [@shakyshane](https://github.com/shakyShane) & [@AydinHassan](https://github.com/AydinHassan)\n\n![tfunk](http://f.cl.ly/items/15102k441h1U1Z1l253J/Screen%20Shot%202014-09-10%20at%2022.05.15.png)\n\n##Install\n\n```bash\nnpm install tfunk\n```\n\n##Usage\n\n**Syntax rules:**\n\n`{` `<color>` `:` `YOUR STRING` `}`\n\n**Example**\n\n`{blue:This is a blue line}`\n\n**`}` is optional**\n\n`{blue:This is a blue line` <- Perfectly valid \n\n\n##Usage\n```js\nvar tFunk = require(\"tfunk\");\n\nconsole.log( tfunk(\"{cyan:tFunk terminal colours\") )\n\n// => tFunk terminal colours\n```\n\nOr get a custom compiler with a set prefix:\n\n```js\nvar compiler = require(\"tfunk\").Compiler({\n    prefix: \"[{magenta:tFunk}]\"\n});\n\nconsole.log( compiler.compile(\"tFunk is awesome\") );\nconsole.log( compiler.compile(\"don't you think?\") );\n\n// => [tFunk] tFunk is awesome\n// => [tFunk] don't you think?\n```\n\n**Define your own syntax**\n\nYou can define your own methods, they receive the string section as the first parameter & have access to the compiler\nthrough `this.compile()` keyword.\n\n```js\nvar compiler = require(\"tfunk\").Compiler({\n    \"warn\": function(string) {\n        return this.compile(\"{red:WARNING:\" + string);\n    }\n});\n```\n\nNow you can use `warn` anywhere you like.\n\n```js\nconsole.log( compiler.compile(\"{warn: Could not file your config file...\") );\n\n// => WARNING: Could not file your config file...\n```\n\n##Examples\n\nHere are some comparisons to chalk, to help you understand how to use tFunk.\n\n###Single Colours\n\n```js\n// chalk\nconsole.log( chalk.red(\"This has a single colour\") );\n\n// tFunk\nconsole.log( tFunk(\"{red:This has a single colour\") );\n```\n\n###Single Colour mid string\n\n```js\n// chalk\nconsole.log( \"This has a single colour \" + chalk.cyan(\"that begins mid-string\") );\n\n// tFunck\nconsole.log( tFunk(\"This has a single colour {cyan:that begins mid-string\") );\n```\n\n###Single Colour with end point\n\n```js\n// chalk\nconsole.log( chalk.red(\"This has a single colour with \") + \"an endpoint\");\n\n// tFunk\nconsole.log( tFunk(\"{red:This has a single colour with }an endpoint\") );\n```\n\n###Two Colours\n\n```js\n// chalk\nconsole.log( chalk.green(\"This has \") + chalk.cyan(\"two colours\") );\n\n// tFunk\nconsole.log( tFunk(\"{green:This has {cyan:two colours\") );\n```\n\n###Nested Colours\n\n```js\n// chalk\nconsole.log( chalk.green(\"This has a colour \" + chalk.cyan(\"nested inside\") + \" another colour\") );\n\n//tFunk\nconsole.log( tFunk(\"{green:This has a colour {cyan:nested inside} another colour\") );\n```\n\n###Multiple Nested\n\n```js\n// chalk\nconsole.log( chalk.blue(\"Multiple \" + chalk.cyan(\"NESTED\") + \" styles in \" + chalk.red(\"the same string\") + \" with an ending\") );\n\n// tFunk\nconsole.log( tFunk(\"{blue:Multiple {cyan:NESTED} styles in {red:the same string} with an ending\") );\n```\n\n###Multi line\n```js\nvar multiline = require(\"multiline\");\n\nvar string = multiline(function () {/*\n{cyan:This is a multi-line coloured string\nWith a single {yellow:yellow} word in the center of a line\nPretty cool huh?\n*/});\n\nconsole.log( tFunk(string) );\n```\n\n###Escaping when you need curly braces\n```js\nconsole.log( tFunk(\"This has a \\\\{\\\\{mustache\\\\}\\\\}\") );\n```\n\n\n##TODO\n- [x] Colours\n- [x] Nested Colours\n- [x] Custom syntax\n- [x] Prefixed compiler\n- [x] Make the chain-able API work like this `\"{white.bgRed: White text, red BG\"`\n- [x] Offer a way of escaping. Right now, ALL instances of `}` will be lost\n","publish_time":1602961121725,"_cnpm_publish_time":1602961121725,"dist-tags":{"latest":"4.0.0"}}