node-util icon indicating copy to clipboard operation
node-util copied to clipboard

util.inspect() options maxArrayLength, breakLength

Open mk-pmb opened this issue 7 years ago • 0 comments

Does anyone know a browser-compatible inspect module that supports them, or can add support for them here?

Using [email protected], Node.js v6.9.4, npm v3.10.10, Ubuntu 14.04.5 LTS trusty:

var nums = [ 1, 2, 3, 4, 5 ],
  opts = { depth: null, maxArrayLength: 2, breakLength: 2 };
console.log("node:", require("util").inspect(nums, opts));
console.log("util:", require("util/util.js").inspect(nums, opts));

prints:

node: [ 1,
  2,
  ... 3 more items ]
util: [ 1, 2, 3, 4, 5 ]

mk-pmb avatar Jan 28 '17 00:01 mk-pmb