util

A browser-compatible implementation of Node.js's util module

Library
npm
v0.12.5
255 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
42 /100 Fair
Development Activity 0
Maintenance 20
Community 68
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
65 /100 Good
Architecture 60
Code Quality 68
Innovation 40
Learning Curve 90

The util package ports Node.js’s built-in util module to environments that don’t already have it, most notably web browsers. It exists so that code written against Node’s util.inherits, util.promisify, util.inspect, util.format, and related helpers can run unmodified when bundled for the browser by tools like Browserify or Webpack (up to v4; v5+ requires an explicit fallback).

Rather than reimplementing Node’s behavior from scratch, the project’s contribution model is to port code, bugfixes, and tests directly from Node.js core and transpile them to ES5, keeping the module’s behavior as close to the real util module as practical while acknowledging that some methods (like inspect and format) are intentionally simpler and more barebones than their Node.js counterparts.

What You Get

  • A browser-safe implementation of Node’s util.inherits, util.promisify, and util.callbackify
  • Simplified but functional util.inspect and util.format implementations for object/string formatting
  • Type-checking helpers ported from Node.js (isArray, isBuffer, isFunction, and similar is* predicates)
  • A browser-specific isBuffer shim swapped in automatically via the browser field in package.json when bundled
  • Node 8 LTS-compatible API surface, maintained as a deliberate close port of upstream Node.js behavior

Common Use Cases

  • Bundling Node.js-oriented libraries for the browser with Browserify or Webpack (≤v4) where util is auto-resolved as a dependency
  • Explicitly polyfilling util in Webpack 5+ projects via the resolve.fallback configuration
  • Using util.inherits for classical prototype-based inheritance in code intended to run in both Node and browser environments
  • Running libraries originally written for Node.js in non-Node JavaScript engines that lack a native util module

Under The Hood

Architecture The entire implementation lives in a single ~715-line util.js file that mirrors the shape of Node.js’s core util module: a flat set of exported functions (inherits, format, inspect, promisify, callbackify, various is* type predicates) with no internal class hierarchy or plugin system. Browser/Node divergence is handled via package.json’s browser field, which swaps support/isBuffer.js for support/isBufferBrowser.js when bundled, since browsers lack Node’s native Buffer type-checking hooks. This keeps the core logic identical across environments while isolating the one genuinely platform-specific concern.

Tech Stack Plain ES5-targeted JavaScript with no build/transpile step of its own beyond what consuming bundlers (Browserify, Webpack) apply; runtime dependencies are small polyfill/type-check helpers (inherits, is-arguments, is-generator-function, is-typed-array, which-typed-array) that each cover one ES6+ type-detection gap on older engines. Testing uses tape for Node-side tests and airtap to run the browser test suite across real browser engines via Sauce Labs/local runners.

Code Quality The module has separate test/node and test/browser suites, reflecting the project’s core commitment to environment parity, and its CONTRIBUTING guidance explicitly directs contributors to port code and tests from Node.js core verbatim rather than reimplement behavior — a deliberate quality control that keeps drift from upstream low. Because the module’s job is to mirror an external, well-specified API (Node’s util), the code itself doesn’t need novel error handling; it defers to Node.js’s documented behavior as the source of truth for correctness.

API Design The API is Node.js’s own util module API by design — there is zero learning curve for anyone already familiar with Node, since the package’s explicit goal is to be a drop-in replacement. This constrains innovation but maximizes compatibility: a consumer requires util exactly as they would in Node, and it behaves the same, with the explicit caveat that inspect and format are simplified relative to the full Node.js implementations.

Used by 22 apps in this directory

TypeScript
95%
MIT

Actual

Invoicing Finance

29,186

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
73
Dependency
Built with
TypeScript 95%
Updated 4 days ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
96%
Other

Amplication

AI Code Assistants · Automation · Developer Tools

16,015

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
58
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 96%
Updated 3 months ago
TypeScript
89%
Other

anytype-ts

Collaboration · Knowledge Management · Note Taking

8,861

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
Rust
67%
MIT

Bun

Developer Tools

96,068

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust 67%
C++ 19%
TypeScript 10%
Updated 5 days ago
TypeScript
53%
Other

Chaskiq

CRM · Customer Support

3,574

Self-hosted live chat, video calls, help center, and marketing automation — a full-stack Intercom alternative you run on your own infrastructure.

View details
57
Repo Health
66
Technical
66
Dependency
Built with
TypeScript 53%
Ruby 36%
Updated 3 months ago
TypeScript
72%
MIT

Claude Context

AI Code Assistants · Mcp

12,573

An MCP server and VS Code extension by Zilliz that turns your entire codebase into semantically searchable context for Claude Code, Cursor, and Gemini CLI, using vector embeddings and Merkle-tree change detection.

View details
46
Repo Health
71
Technical
71
Dependency
Built with
TypeScript 72%
Python 13%
JavaScript 11%
Updated 2 months ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
Ruby
61%
GPL 2.0

Discourse

Community

47,915

Open-source community platform with dynamic trust levels, real-time chat, and a powerful plugin architecture for self-hosted forums.

View details
89
Repo Health
89
Technical
67
Dependency
Built with
Ruby 61%
JavaScript 32%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers