handle the ability to pass in variable arguments (ex.

chalk.green("it's", "over", 9000)). updated readme to show support of
variable arguments.
This commit is contained in:
Andrew Kennedy 2013-10-07 00:34:32 -04:00
parent 0133342393
commit 6bb27b7759
3 changed files with 17 additions and 3 deletions

View file

@ -34,13 +34,16 @@ var chalk = require('chalk');
console.log(chalk.blue('Hello world!'));
// combine styled and normal strings
console.log(chalk.blue('Hello') + 'World' + chalk.red('!'));
console.log(chalk.blue('Hello'), 'World' + chalk.red('!'));
// compose multiple styles using the chainable API
console.log(chalk.blue.bgRed.bold('Hello world!'));
// nest styles
chalk.red('Hello' + chalk.underline.bgBlue('world') + '!');
chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
// pass in multiple arguments
console.log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'))
```
You can easily define your own themes.
@ -58,6 +61,7 @@ console.log(error('Error!'));
Chain [styles](#styles) and call the last one as a method with a string argument.
Multiple arguments are also supported. Chalk will add a space between each one.
### chalk.enabled