parent
ed6e7d56da
commit
83615f2ed6
1 changed files with 9 additions and 4 deletions
13
readme.md
13
readme.md
|
|
@ -42,13 +42,18 @@ $ npm install --save chalk
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
|
||||||
// style a string
|
console.log(chalk.blue('Hello world!'));
|
||||||
chalk.blue('Hello world!');
|
```
|
||||||
|
|
||||||
|
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
||||||
|
|
||||||
|
Here without `console.log` for purity.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
// combine styled and normal strings
|
// combine styled and normal strings
|
||||||
chalk.blue('Hello') + 'World' + chalk.red('!');
|
chalk.blue('Hello') + 'World' + chalk.red('!');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue