Registry / http-networking / esbuild-node-builtins

esbuild-node-builtins

JSON →
library0.1.0jsnpmunverified

esbuild-node-builtins is a plugin for esbuild that provides polyfilled Node.js built-in modules (e.g., 'fs', 'path', 'crypto') for browser or other non-Node environments. Version 0.1.0 is the initial stable release, with no further updates or release cadence documented. It wraps browserify's 'node-libs-browser' to polyfill core modules, enabling bundling of Node-centric code for the browser with esbuild. Unlike esbuild's native 'platform: node', this plugin actually inlines polyfills; it is a simple integration but has no active maintenance and may be superseded by esbuild's own node polyfills or other plugins like 'esbuild-plugin-polyfill-node'.

npm install esbuild-node-builtins
INSTALL
IMPORT
SIG · ESBUILD-NODE-BUILT
E
esbuild-node-builtins
http-networkingjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nodeBuiltIns
const { nodeBuiltIns } = require('esbuild-node-builtins')
const nodeBuiltIns = require('esbuild-node-builtins')
Default export is not available; must destructure the named export 'nodeBuiltIns'. CJS only, no ESM export.
nodeBuiltIns
import { nodeBuiltIns } from 'esbuild-node-builtins'
import nodeBuiltIns from 'esbuild-node-builtins'
The package does not export a default, so named import is required. However, the package has no 'module' entry and may not work in ESM contexts; prefer require().
nodeBuiltIns
const { nodeBuiltIns } = await import('esbuild-node-builtins')
const { default: nodeBuiltIns } = await import('esbuild-node-builtins')
Dynamic import works but only the named export is available; no default export.

Shows how to require and use the nodeBuiltIns plugin in an esbuild build script for browser bundling.

const { build } = require('esbuild'); const { nodeBuiltIns } = require('esbuild-node-builtins'); build({ entryPoints: ['./app.js'], bundle: true, outfile: './out.js', platform: 'browser', plugins: [nodeBuiltIns()], }).catch(() => process.exit(1));
Debug
Known issues
deprecatedPackage is no longer maintained; use esbuild-plugin-polyfill-node or esbuild's native node polyfill via platform: 'node'
fix
Switch to 'esbuild-plugin-polyfill-node' (npm) or use esbuild's native handling by setting platform: 'node'.
affects: >=0.0
gotchaCannot use ES module import syntax; package requires CommonJS require()
fix
Use require() or dynamic import() with .mjs extension / type: module? Not recommended.
affects: >=0.0
gotchaNot all Node.js built-ins are polyfilled; relies on node-libs-browser which may be incomplete
fix
Test your code thoroughly; consider contributing to node-libs-browser or using a more comprehensive polyfill.
affects: >=0.0
Errors
Common errors & fixes
Cannot find module 'esbuild-node-builtins'
Package not installed or missing from node_modules
fix
Run 'npm install esbuild-node-builtins' or 'yarn add esbuild-node-builtins'
TypeError: (intermediate value).nodeBuiltIns is not a function
Wrong import style: using default import instead of named destructuring
fix
Use 'const { nodeBuiltIns } = require("esbuild-node-builtins")' (note curly braces)
Error: Could not resolve 'fs' (or similar built-in module)
nodeBuiltIns plugin not registered in esbuild's plugins array
fix
Add nodeBuiltIns() to the plugins array and ensure esbuild is configured with platform: 'browser'
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
node-libs-browserrequiredprovides the polyfill implementations for Node built-in modules
esbuildrequiredpeer dependency; the plugin is used as an esbuild plugin
Agent activity
8 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
esbuild-node-builtins — npm install esbuild-node-builtins · libregistry