Skip to content

Commit 49e144d

Browse files
committed
Update example
1 parent 96f6388 commit 49e144d

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/docs/example.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@ npm install --save verbosity
99
Simply override the built in console object:
1010

1111
```javascript
12-
const console = require('../../index.js').createConsole({
13-
outStream: process.stdout,
14-
errorStream: process.stderr,
15-
verbosity: 5
12+
import {createConsole} from 'verbosity'
13+
14+
const console = createConsole({
15+
outStream: process.stdout,
16+
errorStream: process.stderr,
17+
verbosity: 5
1618
})
1719
```
1820

1921
This will direct all console output to stderr, but silence 'info' and 'debug' messages.
2022

2123
```javascript
22-
const console = require('../../index.js').createConsole({
23-
outStream: process.stderr,
24-
verbosity: 3
24+
import {createConsole} from 'verbosity'
25+
26+
const console = createConsole({
27+
outStream: process.stderr,
28+
verbosity: 3
2529
})
2630

2731
console.log('Picked brown jacket...') // Printed
@@ -32,9 +36,11 @@ console.warn("That tie doesn't go with that jacket.") // Printed
3236
Or go mad with making up any number of custom console writers.
3337

3438
```javascript
35-
const myUberConsole = require('../../index.js').createConsole({
36-
outStream: myFancyWriteableStream,
37-
verbosity: 5
39+
import {createConsole} from 'verbosity'
40+
41+
const myUberConsole = createConsole({
42+
outStream: myFancyWriteableStream,
43+
verbosity: 5
3844
})
3945

4046
myUberConsole.panic('Core Flux Capacitor Meltdown!')

0 commit comments

Comments
 (0)