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

vxyz

v0.0.1

Published

Small immutable object utilities for TypeScript.

Readme

NPM Package

A small, immutable object utility kit for TypeScript and modern ESM projects.

Requirements

  • Node.js 18 or newer
  • TypeScript projects should use module: "NodeNext" or an equivalent ESM setup.

Install

use npm to install

Development

npm install
npm run dev
npm test
npm run typecheck
npm run build

npm run dev executes examples/demo.ts directly with tsx.

API

All functions return new values where a transformation is required. Inputs are not mutated.

deepClone(value)

Clones arrays, plain objects, Date, RegExp, Map, and Set. Circular references are preserved. Functions and unsupported host objects remain references. Property descriptors and prototypes are retained for ordinary objects.

deepMerge(left, right)

Recursively merges plain objects. The right-hand value wins for arrays, dates, maps, sets, and primitives. Neither input is changed.

getPath(value, path, fallback?)

Reads a dotted path (user.profile.name) or a path array (['user', 'profile', 'name']). Missing paths and undefined values return fallback.

setPath(source, path, value)

Creates a new object or array path and sets the value. Numeric path segments create arrays. An empty path returns the supplied value.

omitPaths(source, paths)

Copies the source and removes each listed path. Array indexes are removed with splice, so later indexes shift.

pickPaths(source, paths)

Builds a new object from existing paths. Missing paths are ignored. Shared prefixes are combined.

objectDiff(left, right)

Returns the first difference in deterministic key order as { path, left, right }, or null when values are deeply equal. Array length differences are reported at the length path.

stableStringify(value)

Returns JSON with sorted object keys, making equivalent key orderings stable. Dates, maps, sets, bigint values, and cycles receive deterministic representations. It follows JSON behavior for unsupported values.

objectSchema(value, schema)

Validates a plain object. A schema is a nested object whose leaves are predicates. It returns { valid, errors } and never throws for invalid input. Predicates receive unknown values.

const result = objectSchema(input, {
	name: (value) => typeof value === 'string',
	profile: { age: (value) => typeof value === 'number' },
})

objectKit

A single object containing all utilities for consumers who prefer one import.

Design notes

The API intentionally has few options. Dotted paths use . as the separator, empty path segments are ignored, arrays are replaced during merge, and schema validation collects all errors instead of stopping at the first one.