{"id":25305,"library":"esbuild-node-builtins","title":"esbuild Node.js Builtins Plugin","description":"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'.","status":"abandoned","version":"0.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install esbuild-node-builtins","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-node-builtins","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-node-builtins","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"provides the polyfill implementations for Node built-in modules","package":"node-libs-browser","optional":false},{"reason":"peer dependency; the plugin is used as an esbuild plugin","package":"esbuild","optional":false}],"imports":[{"note":"Default export is not available; must destructure the named export 'nodeBuiltIns'. CJS only, no ESM export.","wrong":"const nodeBuiltIns = require('esbuild-node-builtins')","symbol":"nodeBuiltIns","correct":"const { nodeBuiltIns } = require('esbuild-node-builtins')"},{"note":"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().","wrong":"import nodeBuiltIns from 'esbuild-node-builtins'","symbol":"nodeBuiltIns","correct":"import { nodeBuiltIns } from 'esbuild-node-builtins'"},{"note":"Dynamic import works but only the named export is available; no default export.","wrong":"const { default: nodeBuiltIns } = await import('esbuild-node-builtins')","symbol":"nodeBuiltIns","correct":"const { nodeBuiltIns } = await import('esbuild-node-builtins')"}],"quickstart":{"code":"const { build } = require('esbuild');\nconst { nodeBuiltIns } = require('esbuild-node-builtins');\n\nbuild({\n  entryPoints: ['./app.js'],\n  bundle: true,\n  outfile: './out.js',\n  platform: 'browser',\n  plugins: [nodeBuiltIns()],\n}).catch(() => process.exit(1));","lang":"javascript","description":"Shows how to require and use the nodeBuiltIns plugin in an esbuild build script for browser bundling."},"warnings":[{"fix":"Switch to 'esbuild-plugin-polyfill-node' (npm) or use esbuild's native handling by setting platform: 'node'.","message":"Package is no longer maintained; use esbuild-plugin-polyfill-node or esbuild's native node polyfill via platform: 'node'","severity":"deprecated","affected_versions":">=0.0"},{"fix":"Use require() or dynamic import() with .mjs extension / type: module? Not recommended.","message":"Cannot use ES module import syntax; package requires CommonJS require()","severity":"gotcha","affected_versions":">=0.0"},{"fix":"Test your code thoroughly; consider contributing to node-libs-browser or using a more comprehensive polyfill.","message":"Not all Node.js built-ins are polyfilled; relies on node-libs-browser which may be incomplete","severity":"gotcha","affected_versions":">=0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install esbuild-node-builtins' or 'yarn add esbuild-node-builtins'","cause":"Package not installed or missing from node_modules","error":"Cannot find module 'esbuild-node-builtins'"},{"fix":"Use 'const { nodeBuiltIns } = require(\"esbuild-node-builtins\")' (note curly braces)","cause":"Wrong import style: using default import instead of named destructuring","error":"TypeError: (intermediate value).nodeBuiltIns is not a function"},{"fix":"Add nodeBuiltIns() to the plugins array and ensure esbuild is configured with platform: 'browser'","cause":"nodeBuiltIns plugin not registered in esbuild's plugins array","error":"Error: Could not resolve 'fs' (or similar built-in module)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}