Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 7, 2026·3 min de lectura

Browserify — Use Node.js require() in the Browser

A tool that bundles Node.js-style modules for the browser, enabling developers to use require() and npm packages in client-side JavaScript.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Browserify Overview
Comando de instalación directa
npx -y tokrepo@latest install 7493126d-7a00-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Browserify brought Node.js-style CommonJS modules to the browser by recursively analyzing require() calls and bundling all dependencies into a single file. It was the first widely adopted JavaScript module bundler and proved that npm packages could power front-end applications.

What Browserify Does

  • Recursively resolves require() calls and bundles them into one browser-ready file
  • Shims Node.js built-in modules (path, events, stream, buffer) for browser use
  • Supports source maps for debugging bundled code
  • Applies code transforms (Babel, CoffeeScript, envify) via a plugin pipeline
  • Generates standalone UMD bundles for library distribution

Architecture Overview

Browserify starts from an entry file, parses its AST to find require() calls, recursively resolves each dependency from node_modules or relative paths, and concatenates everything into a single output file wrapped in a lightweight module loader. The transform system intercepts files before parsing, allowing transpilation and preprocessing.

Self-Hosting & Configuration

  • Install globally or as a dev dependency for CLI or API usage
  • Configure transforms and plugins in the browserify field of package.json
  • Use watchify for incremental rebuilds during development
  • Generate standalone bundles with --standalone for library distribution
  • Pair with minifiers like uglifyify (transform) or UglifyJS (post-bundle)

Key Features

  • First-class CommonJS require() support matching Node.js semantics
  • Shims for Node.js core modules enabling isomorphic code
  • Transform pipeline for preprocessing files before bundling
  • Plugin system for custom output handling and build orchestration
  • Incremental builds via watchify for fast development feedback

Comparison with Similar Tools

  • webpack — More feature-rich bundler with code splitting, loaders, and built-in optimization; became the dominant bundler after Browserify
  • Rollup — Focuses on ES modules with tree shaking for smaller library bundles
  • esbuild — Extremely fast bundler written in Go; supports both ESM and CommonJS
  • Vite — Dev server with native ESM support and Rollup-based production builds; the current default for many frameworks

FAQ

Q: Is Browserify still relevant? A: Browserify is in maintenance mode. Modern projects typically use webpack, Vite, or esbuild, but Browserify remains functional for existing projects and educational purposes.

Q: How does Browserify differ from webpack? A: Browserify focuses on CommonJS bundling with a Unix-philosophy pipeline of small transforms. webpack provides a broader feature set including code splitting, asset handling, and hot module replacement.

Q: Can Browserify handle ES modules? A: Not natively. You can use the esmify transform to convert ES module syntax to CommonJS before bundling.

Q: What is watchify? A: watchify is a companion tool that watches source files and incrementally rebuilds only changed modules, providing fast rebuild times during development.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados