{"id":25376,"library":"esbuild-plugin-node-polyfills","title":"esbuild-plugin-node-polyfills","description":"Provides Node.js built-in module polyfills for esbuild bundler, similar to Webpack's 'node' option. Version 1.0.2 (latest, 2021) is stable but unmaintained since. Requires manual installation of peer dependencies: browserify-zlib, buffer, crypto-browserify, events, https-browserify, os-browserify, path-browserify, process, stream-browserify, stream-http, url, util. Compared to alternatives like @esbuild-plugins/node-globals-polyfills, this plugin offers a more complete set of polyfills but lacks ESM support and TypeScript definitions.","status":"maintenance","version":"1.0.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/sinnaj-r/esbuild-plugin-node-polyfills","tags":["javascript"],"install":[{"cmd":"npm install esbuild-plugin-node-polyfills","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-node-polyfills","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-node-polyfills","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"polyfills Node.js zlib module","package":"browserify-zlib","optional":false},{"reason":"polyfills Node.js buffer module","package":"buffer","optional":false},{"reason":"polyfills Node.js crypto module","package":"crypto-browserify","optional":false},{"reason":"peer dependency for plugin usage","package":"esbuild","optional":false},{"reason":"polyfills Node.js events module","package":"events","optional":false},{"reason":"polyfills Node.js https module","package":"https-browserify","optional":false},{"reason":"polyfills Node.js os module","package":"os-browserify","optional":false},{"reason":"polyfills Node.js path module","package":"path-browserify","optional":false},{"reason":"polyfills Node.js process module","package":"process","optional":false},{"reason":"polyfills Node.js stream module","package":"stream-browserify","optional":false},{"reason":"polyfills Node.js http module","package":"stream-http","optional":false},{"reason":"polyfills Node.js url module","package":"url","optional":false},{"reason":"polyfills Node.js util module","package":"util","optional":false}],"imports":[{"note":"The package uses CommonJS; no ESM export is provided. Use require.","wrong":"import ESBuildNodePolyfillsPlugin from 'esbuild-plugin-node-polyfills';","symbol":"ESBuildNodePolyfillsPlugin","correct":"const ESBuildNodePolyfillsPlugin = require('esbuild-plugin-node-polyfills');"}],"quickstart":{"code":"const ESBuildNodePolyfillsPlugin = require('esbuild-plugin-node-polyfills');\nconst esbuild = require('esbuild');\n\nrequire('esbuild').build({\n  entryPoints: ['src/index.js'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  plugins: [ESBuildNodePolyfillsPlugin],\n}).catch(() => process.exit(1));","lang":"javascript","description":"Demonstrates how to configure esbuild with the node polyfills plugin using CommonJS."},"warnings":[{"fix":"Run: npm install browserify-zlib buffer crypto-browserify events https-browserify os-browserify path-browserify process stream-browserify stream-http url util","message":"All dependencies must be installed manually as peer dependencies; automatic installation is not provided.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use require() instead of import.","message":"The plugin only works with CommonJS; it cannot be imported using ES module syntax (import).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using @esbuild-plugins/node-globals-polyfills for more controlled polyfilling.","message":"Polyfills are injected globally, which may cause unexpected side effects in libraries that expect the original Node.js behavior.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install buffer","cause":"Missing peer dependency 'buffer' is not installed.","error":"Cannot find module 'buffer'"},{"fix":"Change to: const ESBuildNodePolyfillsPlugin = require('esbuild-plugin-node-polyfills');","cause":"Using import instead of require; the package exports a function via CommonJS.","error":"Error: The plugin 'ESBuildNodePolyfillsPlugin' is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}