object-inspect
string representations of objects in node and the browser
Last updated 8 years ago by ljharb .
MIT · Repository · Bugs · Original npm
$ cnpm install object-inspect 
SYNC missed versions from official npm registry.

object-inspect

string representations of objects in node and the browser

testling badge

build status

example

circular

var inspect = require('object-inspect');
var obj = { a: 1, b: [3,4] };
obj.c = obj;
console.log(inspect(obj));

dom element

var inspect = require('object-inspect');

var d = document.createElement('div');
d.setAttribute('id', 'beep');
d.innerHTML = '<b>wooo</b><i>iiiii</i>';

console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ]));

output:

[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ]

methods

var inspect = require('object-inspect')

var s = inspect(obj, opts={})

Return a string s with the string representation of obj up to a depth of opts.depth.

Additional options:

  • quoteStyle: must be "single" or "double", if present

install

With npm do:

npm install object-inspect

license

MIT

Current Tags

  • 1.12.3                                ...           latest (3 years ago)

10 Versions

  • 1.12.3                                ...           3 years ago
  • 1.12.2                                ...           3 years ago
  • 1.12.1                                ...           3 years ago
  • 1.12.0                                ...           4 years ago
  • 1.11.0                                ...           4 years ago
  • 1.9.0                                ...           5 years ago
  • 1.8.0                                ...           5 years ago
  • 0.4.0                                ...           11 years ago
  • 1.4.1                                ...           8 years ago
  • 1.7.0                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org