NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #468 most downloaded on npm
Node's event emitter for all engines.
Last release 6 years ago
no release in 18 months
Ships fairly regularly
a new release about every 9 months
Some releases are documented
notes for 9 of 17 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
17 releases · first in 2011
Support EventTarget emitters in events.once from Node.js 12.11.0.
Support EventTarget emitters in events.once from Node.js 12.11.0.
Now you can use the events.once function with objects that implement the EventTarget interface. This interface is used widely in
the DOM and other web APIs.
var events = require('events');
var assert = require('assert');
async function connect() {
var ws = new WebSocket('wss://example.com');
await events.once(ws, 'open');
assert(ws.readyState === WebSocket.OPEN);
}
async function onClick() {
await events.once(document.body, 'click');
alert('you clicked the page!');
}One column per quarter.
Add events.once from Node.js 11.13.0.
Add events.once from Node.js 11.13.0.
To use this function, Promises must be supported in the environment. Use a polyfill like es6-promise if you support older browsers.
events now matches the Node.js 11.12.0 API.
events now matches the Node.js 11.12.0 API.
pass through return value in wrapped emitter.once() listeners
Now, this works:
emitter.once('myevent', function () { return 1; });
var listener = emitter.rawListeners('myevent')[0]
assert(listener() === 1);Previously, listener() would return undefined regardless of the implementation.
Ported from nodejs/node@acc506c
Reduce code duplication in listener type check (#67 by @friederbluemle).
Improve emitter.once() performance in some engines
This version drops support for IE8. events no longer includes polyfills for ES5 features. If you need to support older environments, use an ES5 shim l
This version drops support for IE8. events no longer includes polyfills
for ES5 features. If you need to support older environments, use an ES5 shim
like es5-shim. Both the shim and sham
versions of es5-shim are necessary.
off() methodadd Emitter#rawListeners from Node.js v9.4
Update to events code from node.js 8.x
prependListener() and prependOnceListener()eventNames() methodonce() listeners in listeners()Note that this version doubles the gzipped size, jumping from 1.1KB to 2.1KB,
due to new methods and runtime performance improvements. Be aware of that when
upgrading.
add more context to errors if they are not instanceof Error
add Emitter#listerCount (to match node v4 api)
check for console.trace before using it
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →