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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bybrave/object-path2

v1.0.0

Published

Maintained fork of object-path — access/set deep object properties by path, now dual ESM+CJS, 0 dependencies, with built-in TypeScript types

Readme

@bybrave/object-path2

Maintained, drop-in fork of object-path — access and set deep object properties by a string/array path (get, set, has, del, push, insert, empty, coalesce, ensureExists).

The original has been unmaintained since 2023 (last release 0.11.8), ships no ESM build, and has no bundled TypeScript types. This fork keeps the exact same API and behavior, byte-for-byte compatible with the original test suite, and adds what modern projects need.

npm install @bybrave/object-path2

Why this fork

| Improvement | Detail | |---|---| | Dual ESM + CJS | Native import and require from a single package via the exports map — no more ERR_REQUIRE_ESM / bundler workarounds | | Built-in TypeScript types | index.d.ts bundled — you no longer need a separate @types/object-path install | | Zero dependencies | No runtime deps, nothing transitive to audit | | Bug fix — set through a null node (#97 / #94) | set({a: null}, 'a.b', 'c') now rebuilds the container instead of throwing Cannot set property 'b' of null | | Modern tooling | Node 18/20/22 CI, tests on node:test, prototype-pollution protection covered by an explicit CVE test |

Prototype-pollution protection (__proto__ / prototype / constructor) from upstream is preserved and covered by tests.

Compatibility

100% API-compatible with [email protected]. The fork passes the original upstream test suite unchanged (test/compat.js) plus its own tests. The only behavioral change is the set-through-null fix above, which lives in a case the original left as an unhandled throw.

Migration

Drop-in — just change the import specifier:

- const objectPath = require('object-path');
+ const objectPath = require('@bybrave/object-path2');
// ESM + TypeScript (types are bundled)
import objectPath, { get, set } from '@bybrave/object-path2';

You can remove @types/object-path from your devDependencies.

Usage

import objectPath from '@bybrave/object-path2';

const obj = { a: { b: { c: 1 } }, list: [1, 2, 3] };

objectPath.get(obj, 'a.b.c');            // => 1
objectPath.get(obj, 'a.b.x', 'default'); // => 'default'
objectPath.set(obj, 'a.b.d', 2);         // sets obj.a.b.d = 2
objectPath.has(obj, 'a.b.c');            // => true
objectPath.push(obj, 'list', 4);         // list => [1,2,3,4]
objectPath.del(obj, 'a.b.c');            // removes obj.a.b.c

// bound mode — object is pre-bound
const op = objectPath(obj);
op.get('a.b.d');                         // => 2

// inherited-props / security variants
objectPath.withInheritedProps.get(obj, 'a.b.c');
const custom = objectPath.create({ includeInheritedProps: true });

All methods accept the path as a dotted string ('a.b.c'), a number, or an array of segments (['a', 'b', 'c']).

Support

If this package saves you time, you can support maintenance:

Ko-fi Bitcoin

Bitcoin (BTC): bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q

License

MIT © 2015 Mario Casciaro (original object-path), © 2026 bybrave (fork). See LICENSE.