npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

object-walker-js

v1.2.0

Published

Object-Walker-Js is a simple command that lets you search for any object in any other object. Without dependencies, it is a simple and efficient tool to search for objects in objects.

Downloads

13

Readme

Description 📝

Object-Walker-Js is a simple command that lets you search for any object in any other object. Without dependencies, it is a simple and efficient tool to search for objects in objects.

Installation 📦

Library 📚

$ npm install object-walker-js

Binary 📦

Local 🏠

$ npm install object-walker-js
[...]
$ ./node_modules/.bin/object-walker-js --help
Usage: node index.js [options]
Options:
    --h, --help           Display help
    --type                Type of source object
    --target              Target object
    --targetType          Target type of object target, must be:
                          object, function, string, number, boolean, symbol, bigint, any
    --depth               Depth of the search (default: 5)
    --disable-TypeError   Disable TypeError message

Global 🌐

$ sudo npm install -g object-walker-js
[...]
$ object-walker-js --help
Usage: node index.js [options]
Options:
    --h, --help           Display help
    --type                Type of source object
    --target              Target object
    --targetType          Target type of object target, must be:
                          object, function, string, number, boolean, symbol, bigint, any
    --depth               Depth of the search (default: 5)
    --disable-TypeError   Disable TypeError message

Exemple 🎁

Binary 🏹

[!TIP] The --target is evaluated with the eval function, so you can use any valid JavaScript expression.

Type Object 🪙

$ object-walker-js --type '({})' --target '__proto__' --targetType "object" --depth 50
--- Properties and methods of ({}) ---
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__lookupSetter__.isPrototypeOf.propertyIsEnumerable.toString.valueOf.toLocaleString.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__lookupSetter__.isPrototypeOf.propertyIsEnumerable.toString.valueOf.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__lookupSetter__.isPrototypeOf.propertyIsEnumerable.toString.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__lookupSetter__.isPrototypeOf.propertyIsEnumerable.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__lookupSetter__.isPrototypeOf.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__lookupSetter__.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__lookupGetter__.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.hasOwnProperty.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__defineSetter__.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.toString.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.call.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.bind.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.apply.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.prototype.__proto__
[+] ({}).constructor.prototype.__defineGetter__.constructor.__proto__
[+] ({}).constructor.prototype.__defineGetter__.__proto__
[+] ({}).constructor.prototype.__proto__
[+] ({}).constructor.assign.__proto__
[+] ({}).constructor.getOwnPropertyDescriptor.__proto__
[+] ({}).constructor.getOwnPropertyDescriptors.__proto__
[+] ({}).constructor.getOwnPropertyNames.__proto__
[+] ({}).constructor.getOwnPropertySymbols.__proto__
[+] ({}).constructor.hasOwn.__proto__
[+] ({}).constructor.is.__proto__
[+] ({}).constructor.preventExtensions.__proto__
[+] ({}).constructor.seal.__proto__
[+] ({}).constructor.create.__proto__
[+] ({}).constructor.defineProperties.__proto__
[+] ({}).constructor.defineProperty.__proto__
[+] ({}).constructor.freeze.__proto__
[+] ({}).constructor.getPrototypeOf.__proto__
[+] ({}).constructor.setPrototypeOf.__proto__
[+] ({}).constructor.isExtensible.__proto__
[+] ({}).constructor.isFrozen.__proto__
[+] ({}).constructor.isSealed.__proto__
[+] ({}).constructor.keys.__proto__
[+] ({}).constructor.entries.__proto__
[+] ({}).constructor.fromEntries.__proto__
[+] ({}).constructor.values.__proto__
[+] ({}).constructor.__proto__
[+] ({}).__proto__

Type Module 📦

$ object-walker-js --type 'import("fs")' --target 'toString' --targetType "function" --depth 500
[/] --- Properties and methods of import("fs") ---
[+] import("fs").Dir.prototype.read.constructor.prototype.apply.bind.call.toString
[+] import("fs").Dir.prototype.read.constructor.prototype.apply.bind.call.toString.toString
[+] import("fs").Dir.prototype.read.constructor.prototype.apply.bind.call.toString.constructor.prototype.__defineGetter__.toString        
[+] import("fs").Dir.prototype.read.constructor.prototype.apply.bind.call.toString.constructor.prototype.__defineGetter__.__defineSetter__.toString
[+] import("fs").Dir.prototype.read.constructor.prototype.apply.bind.call.toString.constructor.prototype.__defineGetter__.__defineSetter__.hasOwnProperty.toString
[+] import("fs").Dir.prototype.read.constructor.prototype.apply.bind.call.toString.constructor.prototype.__defineGetter__.__defineSetter__.hasOwnProperty.__lookupGetter__.toString
[...]

Library 📚

import { ObjectWalker } from 'object-walker-js';

const type = {};
const target = 'constructor';
const targetType = 'function';
const depth = 5;
const visited = new WeakSet();
const name = '{}';
const displayTypeError = false;
const uniqueProps = ObjectWalker(type, target, targetType, depth, visited, name, displayTypeError);
uniqueProps.forEach(prop => {
   console.log(prop);
});

License 📜

MIT License