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

objectively

v0.1.1

Published

Tiny, dependency-free, strongly-typed object helpers (keys/values/entries/reduce/map/remap/rekey) that carry a documented exact-keys assumption.

Readme

objectively

Tiny, dependency-free, strongly-typed object helpers.

Standard Object.* methods widen keys to string and values to their union. These wrappers keep the object's own key/value types, and add transform helpers that let you name the exact output shape — so the one unavoidable assertion lives here, and your call sites stay cast-free.

Exact-keys assumption. The precise types are produced by an internal as: they assert the object holds no keys beyond those in its type. Safe for literals built in place; a lie for objects that arrive with extra keys.

Install

pnpm add objectively

API

Access — keys · values · entries

Typed Object.keys / Object.values / Object.entries.

import { entries } from "objectively";

for (const [key, value] of entries({ a: 1, b: "x" })) {
  // key: "a" | "b",  value: number | string
}

Fold — reduce

Object-shaped reduce; each key and value carries its own type.

reduce({ a: 1, b: 2 }, (acc, key, value) => acc + value, 0); // 3

Transform values — map · remap

map maps every value, preserving keys. remap<Source, Result> rebuilds into a named result shape whose value type may vary per key.

map({ a: 1, b: 2 }, (v) => v * 10); // { a: 10, b: 20 }

Transform keys — rekey

rekey<Source, Result> transforms each entry into a new [key, value] pair, so the key may change too — prefixing or renaming, landing on a named result shape without a cast at the call site.

import { rekey } from "objectively";

// { variant: "solid" } -> { "data-variant": "solid" }
rekey<Props, Bindings>(props, (key, value) => [`data-${key}`, value]);

Guards — record · object · equals

record narrows to a plain record (prototype is Object.prototype or null), object to any non-array object (class instances included), and equals is deep structural equality (SameValueZero, so NaN equals itself).

import { equals, object, record } from "objectively";

record({ a: 1 }); // true    record([]) / record(new Date()); // false
object(new Date()); // true  object([]); // false
equals({ a: [1, NaN] }, { a: [1, NaN] }); // true

Scripts

  • pnpm build — bundle to .dist via unbuild
  • pnpm test — run the vitest suite
  • pnpm typechecktsc --noEmit
  • pnpm lint — eslint