mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 20:25:27 +00:00

This makes Node pretty-print objects with color by default when `console.log()`-ing them. PR-URL: https://github.com/nodejs/node/pull/19372 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
10 lines
307 B
JavaScript
10 lines
307 B
JavaScript
'use strict';
|
|
require('../common');
|
|
// Make this test OS-independent by overriding stdio getColorDepth().
|
|
process.stdout.getColorDepth = () => 8;
|
|
process.stderr.getColorDepth = () => 8;
|
|
|
|
console.log({ foo: 'bar' });
|
|
console.log('%s q', 'string');
|
|
console.log('%o with object format param', { foo: 'bar' });
|