{"name":"tfunk","version":"0.0.1","description":"Multi-colour console output from [Chalk](https://github.com/sindresorhus/chalk#styles) with added awesome.","main":"index.js","scripts":{"test":"./node_modules/gulp/bin/gulp.js lint-ci && ./node_modules/mocha/bin/mocha test --recursive"},"author":"","license":"ISC","devDependencies":{"chai":"^1.9.1","mocha":"^1.20.1","gulp":"^3.8.6","gulp-jshint":"^1.7.1","jshint-stylish":"^0.4.0"},"dependencies":{"chalk":"^0.5.1"},"_id":"tfunk@0.0.1","dist":{"shasum":"1b241834ffa92c1026aa7d7e9b9d831dd00a2daf","tarball":"http://registry-npm.ywwl.com/tfunk/download/tfunk-0.0.1.tgz","integrity":"sha512-b1KHsTyHWrnUQGTdmaR43FHrD2eQlG5DR6v0DnqCpl4FsNwCbReiyGOxkH3ODY3m6w6xqPgABopFBllvQzMNsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQnjEf7bELvcMFr8qdSFJ8eu3G8izhaDdwTmxszyS52wIhAKEVqH+W+C0uSgZ/s29gMwjl2Zr6szQGpzy+dG2Coq/a"}],"size":5123,"noattachment":false,"key":"/tfunk/-/tfunk-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"shakyshane","email":"shakyshane@gmail.com"},"maintainers":[{"name":"shakyshane","email":"shakyshane@gmail.com"}],"directories":{},"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":1405289149943,"_cnpm_publish_time":1405289149943,"dist-tags":{"latest":"4.0.0"}}