From 13a555ede8773d5bc6e13668573c804ab9a34404 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 16 Dec 2013 21:44:25 +0100 Subject: [PATCH] readme - add string substitution example Fixes #8 --- readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 46813ac..580d4a0 100644 --- a/readme.md +++ b/readme.md @@ -49,7 +49,7 @@ console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') ); ``` -You can easily define your own themes. +Easily define your own themes. ```js var chalk = require('chalk'); @@ -57,6 +57,14 @@ var error = chalk.bold.red; console.log(error('Error!')); ``` +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + ## API