events
A standalone, browser-compatible port of Node.js's built-in EventEmitter
Repository Health
Technical Analysis
events is a from-scratch reimplementation of Node.js’s core events module, ported to ES5 so it can run in environments — chiefly web browsers — that don’t ship Node’s built-in EventEmitter. It deliberately tracks the Node.js API as closely as possible (contributions are expected to be copy-pasted and transpiled from Node.js source rather than reimplemented independently), so code written against Node’s EventEmitter behaves identically when bundled for the browser.
Most developers never install it directly: bundlers like Browserify and Webpack automatically substitute this package whenever bundled code does require('events'), which is why it accumulates tens of millions of weekly downloads despite being a small, rarely-updated utility. Originally authored by Irakli Gozalishvili (Gozala/events), the repository now lives under the browserify GitHub organization, which Gozala’s original repo redirects to.
What You Get
- An
EventEmitterclass with the full Node.jseventsAPI surface (on,once,off,emit,removeListener,removeAllListeners, etc.) prependListener/prependOnceListenersupport matching Node’s ordering semantics- Max-listener leak warnings identical to Node’s built-in behavior
- Special handling of the
'error'event (throws if unhandled, matching Node.js) - Zero runtime dependencies and ES5-only syntax for broad browser compatibility
Common Use Cases
- Automatic substitution by Browserify/Webpack whenever bundled code calls
require('events')in a browser build - Using the familiar Node.js EventEmitter API in isomorphic (universal) JavaScript code that runs in both Node and the browser
- Porting a Node.js library that depends on
eventsto run client-side without rewriting its event-handling logic - Lightweight pub/sub within a browser application without pulling in a heavier event-bus library
Under The Hood
Architecture The entire implementation lives in a single 497-line events.js file exporting one EventEmitter constructor with prototype methods (on, once, off, emit, listenerCount, prependListener, etc.) — there is no module decomposition because the surface area intentionally mirrors Node.js’s own single-file events core module line-for-line. Tech Stack Pure ES5 with zero runtime dependencies; the project explicitly avoids modern syntax to maximize compatibility with older browsers and bundlers, and its own README recommends pairing it with es5-shim for very old targets like IE8. Code Quality The tests/ directory is unusually granular for its size — separate files for max-listeners.js, listener-count.js, prepend.js, remove-listeners.js, special-event-names.js, and subclass.js, each targeting one specific behavior, mirroring Node.js’s own upstream test suite so behavioral drift from Node is caught immediately. API Design By design there is no independent API — the project’s contribution guidelines require new code to be copy-pasted and transpiled from Node.js’s own lib/events.js rather than reimplemented, so its ergonomics are exactly Node’s: familiar to any Node developer, with the tradeoff that browser-specific ergonomics were never a design goal.
Used by 17 apps in this directory
Amplication
Developer Tools · AI Code Assistants · Automation
Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.
Bun
Developer Tools
An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.
Bytebase
Devops
An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.
Chaskiq
CRM · Customer Support
Self-hosted live chat, video calls, help center, and marketing automation — a full-stack Intercom alternative you run on your own infrastructure.
CodeSandbox
Code Editors · Developer Tools
Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.
Craft CMS
CMS
A developer-first PHP CMS with clean-slate content modeling, auto-generated GraphQL API, and a four-tier edition system that scales from solo projects to enterprise deployments.
Element Web
Team Chat · Collaboration
A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.
Enso
Analytics · Data Engineering · Low Code Platforms
A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.
Helicone
Monitoring · AI Development · Analytics
An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.