tekir
All Packages
Decoratorsv0.1.3

@tekir/event-decorators

Event listener decorators.

Installation

$bun add @tekir/event-decorators

Features

  • @Listener class decorator for listener registration
  • @On('event') to listen for events
  • @Once('event') for one-time listeners
  • Metadata collection for auto-registration

Quick Example

TypeScript
import { Listener, On, Once } from '@tekir/event-decorators'

@Listener
class UserListener {
  @On('user:created')
  async sendWelcome(data) { /* send email */ }

  @Once('app:ready')
  async warmCache() { /* preload data */ }
}

Changelog

v0.1.3LatestSeptember 16, 2026
  • Published output now uses the shared Node-targeted ESM bundle pipeline with external dependencies and generated TypeScript declarations, while Bun consumers keep the native source export.
v0.1.2July 23, 2026
  • Package metadata now follows the shared compatible 0.1.x dependency range used by this coordinated Tekir release.
v0.1.1June 13, 2026
  • Multiple event decorators on one method are now all registered. Stacking @On('a') @On('b') (or @On plus @Once) on the same method binds each one separately instead of the last one winning.
  • @On/@Once now throw at decoration time for an empty or whitespace-only event name.
  • @Listener now walks the prototype chain and reads methods without triggering getters, collecting each overridden method once.
  • Found and fixed with Fable.
v0.1.0April 1, 2026
  • Initial release

Other Decorators packages