Skip to content

Commit

Permalink
readme - add string substitution example
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
sindresorhus committed Dec 16, 2013
1 parent b0addb8 commit 13a555e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ 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');
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

Expand Down

0 comments on commit 13a555e

Please sign in to comment.