finds.dev← search

// the find

feross/buffer

★ 1,883 · JavaScript · NOASSERTION · updated Oct 2025

The buffer module from node.js, for the browser.

A browser polyfill for Node.js's Buffer API, backed by Uint8Array. It lets npm packages that use Buffer work in the browser without changes, and was the standard solution for this problem during the Browserify era.

The Uint8Array backing is the right call — no performance-killing object shims, and the prototype chain trick means instanceof checks and typed array interop both work. The test suite is legitimately thorough, porting the actual Node.js buffer tests rather than writing fresh ones from scratch. At 6.75KB gzipped it's not something you'll notice in a bundle. TypeScript types are included.

The benchmarks in the README are from Chrome 38 and Node 0.11, which tells you something about when this project was last actively developed. Modern bundlers (Vite, esbuild, webpack 5) have built-in browser polyfill handling that often makes this unnecessary — you may already be pulling it in transitively without realizing it. The concat and slice operations are measurably slower than raw Uint8Array in every benchmark shown, which matters if you're doing heavy binary processing in a hot path. The CI badge references a GitHub Actions workflow but the README still shows the old SauceLabs browser matrix image, which is broken.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →