Skip to content

Commit 5ffa654

Browse files
committed
chore: updated example
1 parent c8394e1 commit 5ffa654

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

example/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { randomInt } from 'node:crypto';
22
import { styleText } from 'node:util';
33

44
import { createConsole } from 'styled-json-console';
5+
import { mergeStyleOptions } from 'styled-json-console/mergeStyleOptions';
56

67
const myConsole = createConsole({
78
inspectOptions: {
@@ -37,9 +38,9 @@ const myConsole = createConsole({
3738
// stderr settings are merged with stdout settings so you can override only what you want
3839
{
3940
space: 2,
40-
style: {
41-
string: ['white', 'whiteBright'],
42-
},
41+
style: mergeStyleOptions(['whiteBright'], {
42+
number: ['magentaBright'],
43+
}),
4344
},
4445
],
4546
});
@@ -50,6 +51,7 @@ const data = {
5051
randomNumber: randomInt(0, 2 ** 32 - 1),
5152
example: true,
5253
json: JSON.stringify({ a: 1, b: [2], c: { d: 3, e: [4, 5] } }),
54+
nested: { a: 1, b: [2], c: { d: 3, e: [4, 5] } },
5355
};
5456

5557
myConsole.info(JSON.stringify(data));

0 commit comments

Comments
 (0)