Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Tiny JS
  3. nanoevents

nanoevents

MITTypeScript10.0.0

A minimal JavaScript event emitter library with a 108-byte footprint and TypeScript support.

GitHubGitHub
1.6k stars52 forks0 contributors

What is nanoevents?

Nano Events is a minimal event emitter library for JavaScript that provides a simple API for managing custom events. It solves the problem of adding event-driven architecture to applications without the overhead of larger libraries, focusing on a tiny code footprint and developer convenience.

Target Audience

JavaScript and TypeScript developers who need a lightweight, no-frills event system for frontend applications, Node.js projects, or libraries where bundle size is critical.

Value Proposition

Developers choose Nano Events for its extreme minimalism (108 bytes), clean API that eliminates callback reference management, and first-class TypeScript support, making it ideal for performance-sensitive projects.

Overview

Simple and tiny (107 bytes) event emitter library for JavaScript

Use Cases

Best For

  • Adding event-driven patterns to lightweight JavaScript libraries
  • Projects where bundle size optimization is a top priority
  • TypeScript applications requiring type-safe event handling
  • Building custom class-based event systems with minimal overhead
  • Educational projects demonstrating event emitter implementation
  • Replacing bulky event libraries in performance-critical applications

Not Ideal For

  • Projects requiring built-in 'once' event listeners without custom implementation
  • Teams that need Node.js EventEmitter compatibility for interoperability with existing Node.js modules
  • Applications where advanced event features like wildcard matching or error handling are essential

Pros & Cons

Pros

Ultra-Small Size

At only 108 bytes minified and brotlied, it has negligible impact on bundle size, controlled via Size Limit, making it ideal for performance-critical projects.

Convenient Unbinding

The `on` method returns an `unbind` function, eliminating the need to store callback references for removal, simplifying listener management as shown in the README examples.

TypeScript Integration

Full TypeScript support with event type mapping provides compile-time safety for event names and arguments, reducing runtime errors, as demonstrated in the TypeScript section.

Simple API

With just `emit` and `on` methods, the API is focused and straightforward, avoiding aliases and Node.js EventEmitter compatibility overhead for minimal complexity.

Cons

Missing Advanced Features

It lacks built-in utilities like 'once' listeners and a proper removeAllListeners method, requiring manual implementation as admitted in the README's 'Once' and 'Remove All Listeners' sections.

Limited Ecosystem

Being minimal, it offers no plugins or extended features such as error handling or wildcard events, so additional functionality must be built from scratch.

Manual Setup for Extensions

Adding common features like once listeners involves writing custom code, which can increase development overhead compared to more comprehensive libraries.

Frequently Asked Questions

Quick Stats

Stars1,633
Forks52
Contributors0
Open Issues0
Last commit1 month ago
CreatedSince 2016

Tags

#es-modules#tiny-libraries#frontend#nodejs#typescript#size-optimization#javascript#event-emitter

Built With

J
JavaScript
T
TypeScript

Included in

Tiny JS767
Auto-fetched 10 hours ago

Related Projects

mittmitt

🥊 Tiny 200 byte functional event emitter / pubsub.

Stars11,906
Forks487
Last commit2 years ago
onfire.jsonfire.js

:gun: onfire.js is a nano version (~500b) for event-emitter.

Stars496
Forks110
Last commit7 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub