0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/message/util_inspect_error.js

13 lines
334 B
JavaScript
Raw Normal View History

'use strict';
require('../common');
const util = require('util');
const err = new Error('foo\nbar');
console.log(util.inspect({ err, nested: { err } }, { compact: true }));
console.log(util.inspect({ err, nested: { err } }, { compact: false }));
err.foo = 'bar';
console.log(util.inspect(err, { compact: true, breakLength: 5 }));