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

util-inspect-isomorphic

v1.0.0

Published

An isomorphic port of the Node.js API require('node:util').inspect().

Readme

About

A dependency-free isomorphic port of the Node.js API require("node:util").inspect(). Works on any ES6 JS runtime, as it has no dependency on V8 or Node.js. Can be used in the browser, in React Native, etc.

Usage

Install as follows:

npm install util-inspect-isomorphic

Use just like the original (see the official Node.js docs for full details):

import { inspect } from "util-inspect-isomorphic";

// Serialise Errors with cause:
console.error(inspect(new Error("Outer", { cause: new Error("Inner") })));

// Inspect deeply-nested objects:
console.log(inspect({ a: { b: { c: { d: {} } } } }), { depth: null });

// Print with colours:
console.log(inspect(["wow", new Date(), true], { colors: true }));

// Insert an underscore between every 3 digits:
console.log(inspect(1000000000, { numericSeparator: true }));

Engine support

Requires ES6 and ESM support (or a bundler that can downlevel them).

Differences from the original

This library is a port of the Node.js core code in lib/internal/util/inspect.js (and any dependent files) as it was in main on June 2025, so approximately Node.js v24.1.0. Here are the main compromises that had to be made in the port:

  • Proxy types cannot be inspected, so showProxy: true has no effect. Instead of the Proxy itself, the Proxy target will be inspected.
  • For external (cross-realm, etc.) types, we cannot print the memory address, so just print [External: <address unknown>].
  • Limited Promise introspection – we can't tell whether it is <pending>, <rejected>, or resolved, so we write <uninspectable> instead.
  • Type inspection can be fooled, as it doesn't use engine-level introspection.
  • Not all types of TypedArray get special handling. Namely Float16Array, BigInt64Array, and BigUint64Array.
  • Does not apply special colour-highlighting to stack trace lines that enter node_modules or Node.js core modules.

Sources

Here's a file-by-file summary of what was adapted from the Node.js internals or other projects:

See also

I found out about the excellent node-inspect-extracted only after largely finishing this port. There are a few differences between our approaches.

  • node-inspect-extracted:
    • is a CommonJS library, written in JavaScript.
    • is designed to be easy to keep up to date with upstream, whereas util-inspect-isomorphic is a one-time snapshot.
    • has some tests.
  • util-inspect-isomorphic:
    • is a port to ESM, written in TypeScript.
    • is confirmed to work in React Native.
      • I found that I had to change calls such as const { Object } = primordials to primordials.Object to get it to run. I can't be sure whether it was a Hermes runtime issue or a Metro bundling issue.
    • is untested. Use at your own risk!

Contributing

# Clone the repo
git clone [email protected]:shirakaba/util-inspect-isomorphic.git
cd util-inspect-isomorphic

# Install the dev dependencies
npm install

# Build the code from TypeScript to JavaScript
npm run build

# Test the code (e.g. by making a new script)
node ./scripts/test.js