object-inspect <sup>Version Badge</sup>

string representations of objects in node and the browser

github actions coverage License Downloads

npm badge

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:

install

With npm do:

npm install object-inspect

license

MIT

object-inspect - Installation

To install object-inspect via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install object-inspect --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install object-inspect

Learn more about the config option.

PNPM

pnpm install object-inspect --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install object-inspect --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

object-inspect - Download

Download Tarball (v1.13.4)

Integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==
SHASUM 8375265e21bc20d0fa582c22e1b13485d6e00213
Tarball https://js.registry.sudovanilla.org/object-inspect/-/object-inspect-1.13.4.tgz