
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
deep-inspect
Advanced tools
A function to inspect inherited properties as well
npm install deep-inspect
The second argument to this function will be an options
object. It
accepts the following values. Please note that all are optional fields.
showHidden
depth
parentChainLevel
See below for explanations of the options.
showHidden
Setting this option to true
will show all the enumerable properties of the
object. Normally, when you iterate an object with a for..in
loop or with
Object.keys
, the non-enumerable properties will not be shown.
This must be a boolean value and the default value is false
.
depth
If the object is nested structure or the object has many child properties then
setting this option to a valid positive 32 bit integer value, will list all the
properties of the nested structure as well, till the level specified by depth
is reached.
This must be a valid 32 bit integer value and the default value is 1
.
parentChainLevel
This option allows to explore the inheritance chain as well. It will go to the
depth mentioned in parentChainLevel
and list down all the properties of all
the objects on the way.
There is no default value, but if not provided this will be ignored and none of the parent objects in the prototype chain will be inspected.
var inspect = require('deep-inspect');
inspect(1);
// 1
inspect('thefourtheye');
// "thefourtheye"
inspect();
// undefined
var inspect = require('deep-inspect');
inspect([]);
// []
inspect({});
// {}
inspect({1: '2'});
// Object
// └─┬ Key: "1"',
// └── "2"'
var inspect = require('deep-inspect');
var a = {};
Object.defineProperties(a, {
one: {enumerable: true, value: 'one'},
two: {enumerable: false, value: 'two'},
});
inspect(a, {showHidden: true});
// Object
// ├─┬ Key: "one"
// │ └── "one"
// └─┬ Key: "two"
// └── "two"
inspect(a);
// Object
// └─┬ Key: "one"
// └── "one"
var inspect = require('deep-inspect');
function Parent() {}
Parent.prototype.name = 'Parent';
function Child() {}
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;
inspect(new Child(), {parentChainLevel: 4});
// Object
// └─┬ [[Parent]] : Object
// ├─┬ [[Parent]] : Object
// │ ├─┬ [[Parent]] : Object
// │ │ └── [[Parent]] : null
// │ └─┬ Key: "name"
// │ └── "Parent"
// └─┬ Key: "constructor"
// └── [Function Child]
FAQs
Inspect inherited properties. Inspired by Node.js's util
The npm package deep-inspect receives a total of 0 weekly downloads. As such, deep-inspect popularity was classified as not popular.
We found that deep-inspect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.