- BREAKING: Only support Node.js >=20.
- Update dev dependencies.
- Add
package.jsonfilesfield.
- BREAKING: Rename package to
@digitalbazaar/async-node-events. - BREAKING: Convert to module (ESM).
- BREAKING: Require node 14.x.
- BREAKING:
EventEmitteris exported from module.- For CommonJS use
const {EventEmitter} = require('async-node-events'); - For ES Modules use
import {EventEmitter} from 'async-node-events';
- For CommonJS use
- BREAKING: Make
emit()async function and resolve totrue/falseif listeners were called rather than returningthis. - BREAKING: Listeners called through sync functions (
on,off, etc) will all be called in a sync manner, and must not return a Promise. - BREAKING:
emitSyncis now likeemitbut only handles synchronous listeners. - BREAKING:
emitandemitSyncreturnfalsewhen cancelled andtrueif not cancelled. This differs from Node.js API that indicates if there were listeners. UselistenerCountto check for listeners. - Update dependencies.
- Switch from gulp to simple npm scripts and nyc.
- Switch to ES modules using 'esm' for Node.js support.
- Update test suite.
- Modernize code.
- async/await
- arrow functions
- various new ES features
- use Map
- Add eslint support and update style.
off()as alias for removeListener.- Instance
listenerCount().
- BREAKING: Listener manipulation API is now always synchronous. Remove
old explicit sync/async API.
onSync()/onceSync()/addListenerSync()onAsync()/onceAsync()/addListenerAsync()
- Release 1.0.0.
- Add support for promise-based async listeners.
- See git history for changes.