NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #3091 most downloaded on npm
The missing constructor function for creating safe async iterators
Latest stable
3.1.0
Last release 5 months ago
08 Jun 2026
Release timing varies
gaps range from 2 weeks to 3.2 years
Nearly every release is documented
notes for 9 of 10 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
12 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
The @repeaterjs/timers and @repeaterjs/limiters utilities are now folded into the package; the standalone packages are deprecated.
3.1.0 modernizes Repeater without breaking it. If you only import { Repeater } from "@repeaterjs/repeater", it's a drop-in upgrade — nothing changes.
import { Repeater } from 4.5 KB → 2.1 KB gzipped — same API.@repeaterjs/repeater/core — the class + buffers, no combinators (1.4 KB gzipped)@repeaterjs/repeater/combinators — race / merge / zip / latest standalone@repeaterjs/repeater/timers — createDelay / createInterval / createTimeout@repeaterjs/repeater/limiters — createSemaphore / createThrottleRepeater implements Symbol.asyncDispose / Symbol.dispose, so await using / using clean it up on scope exit (a no-op on runtimes without the symbols).@repeaterjs/timers and @repeaterjs/limiters utilities are now folded into the package; the standalone packages are deprecated.The 3.1 export surface is a strict superset of 3.0.6 — nothing removed, verified against the published package. Dependents pinned to ^3.0.x (graphql-yoga, graphql-mesh, hive, …) auto-upgrade cleanly.
Full migration notes are in the CHANGELOG.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release flattens the monorepo into a single package, adds explicit resource
management, and migrates the build to @b9g/libuild.
It is non-breaking for the common case: if you only import { Repeater } from "@repeaterjs/repeater", nothing changes. The breaking-sounding items below only
affect code that imported the separate @repeaterjs/timers / @repeaterjs/limiters
packages, which are now folded in and renamed.
@repeaterjs/repeater/core — the Repeater class and buffers only, without
the static combinators (smaller when you don't need race/merge/zip/latest).@repeaterjs/repeater/combinators — race, merge, zip, latest as plain
functions (the same logic backing Repeater.race etc.).@repeaterjs/repeater/timers — createDelay, createInterval, createTimeout.@repeaterjs/repeater/limiters — createSemaphore, createThrottle.Repeater now implements Symbol.asyncDispose
and Symbol.dispose (both call return()), so await using / using clean up
the repeater on scope exit. The handlers are installed defensively and are no-ops
on runtimes that lack the symbols.exports map for every entry point.@repeaterjs/timers and @repeaterjs/limiters are now part of this package, and
their helpers gained a create prefix: delay → createDelay, interval →
createInterval, timeout → createTimeout, semaphore → createSemaphore,
throttle → createThrottle.Promise.race alternative (replacing the previous Promise.race work-arounds).
Behavior is unchanged.@repeaterjs/timers, @repeaterjs/limiters, @repeaterjs/pubsub,
and @repeaterjs/react-hooks packages are deprecated on npm. timers and
limiters are replaced by the subpath exports above; pubsub and react-hooks
are not carried forward.import { Repeater } from "@repeaterjs/repeater" users: no action needed.@repeaterjs/timers / @repeaterjs/limiters users: switch the import to
@repeaterjs/repeater/timers / /limiters and add the create prefix to the
helper names.Nothing published for this version
Fix promise returned from push function not resolving when using a buffer.
push function not resolving when using a buffer.Add export maps to package.json files for the TypeScript nodenext
nodenextFixed memory leaks in static combinator functions race, merge, zip and latest due to Promise.race.
Fixed missing file in package.json.
Fixed throw method not catching promises in newer versions of v8 (node.js 12+).
build files with target set to es5 rather than esnext
If you used repeaters to simply add and remove event handlers, you can upgrade without worrying about breaking changes. However, if you awaited push c…
This release overhauls the push and stop promises and the return and throw methods to be more in line with the behavior of async generators. If you used repeaters to simply add and remove event handlers, you can upgrade without worrying about breaking changes. However, if you awaited push calls, read the value of the stop promise, or used the return or throw methods in non-trivial ways, this release may break your code.
Previously, the n-th call to push resolved to the value passed to the n-th call to Repeater.prototype.next. This was inaccurate insofar as async generators resume the n-th yield with the value passed to the n+1-th call to next. Additionally, async generators completely ignore the first value passed to next entirely. The former behavior of repeaters was confusing insofar as the first call to push would always resolve immediately, because push could not be called until next was called for the first time. In 3.0, the behavior has now been changed so that the n-th call to push resolves to the n+1-th call to next.
For the most part, code which awaits push will work as expected, except when the code relied on the first call to push resolving immediately. To make sure you’re not relying on the old behavior of push, you should make sure that you await push at the bottom of loops, rather than the top. See the changes to timers as an example.
Calling Repeater.prototype.throw will now cause the previous push call to reject, rather than simply stopping the repeater and throwing the error. This means errors thrown into repeaters are now recoverable. If you call push without awaiting or calling then/catch on the returned promise and then call the throw method, the repeater will rethrow the error, preserving the previous behavior. However, if you await push or otherwise call the then or catch methods, it becomes your responsibility to handle errors thrown in via throw and stop the repeater. #43
The stop promise no longer resolves to the value passed to Repeater.prototype.return. Instead, it consistently fulfills to undefined when the repeater is stopped. Additionally, calling Repeater.prototype.return will return a result whose value is always whatever was passed to return. In the case of premature returns, the return value of the executor is ignored unless it throws an error. #41
This change was made because there is no way with async generators to inspect the value passed to return from within the async generator. Additionally, the only way to modify the result returned from the return method would be to put a return statement in a finally block within the async generator, which is typically considered to be a bad practice. Repeaters now uniformly return the value passed to the return method. See #40 for a longer explanation for why we made this change.
Errors thrown by the executor now take priority over rejections passed to push. If a pushed promise rejects, the repeater will await the execution result and throw an error thrown by the executor instead of the rejected promise.
Changes to combinator methods
Repeater.race and Repeater.mergeRepeater.merge yields non-iterable values, so you can call merge on an iterable of promises to get an async iterator which produces values as each promise fulfills.Changes to typescript typings:
Repeater, RepeaterExecutor, Push and other related types now take the type parameters TReturn and TNext in line with typescript 3.6’s strict async generator typings.RepeaterBuffer interface and concrete classes no longer accept a type parameter. All places where the type parameter would have been used, unknown is used instead. You should never directly add or remove values from buffers.next and return methods have been changed to accept PromiseLike<T> and PromiseLike<TReturn> respectively as parameters.Nothing published for this version
Renamed all instances of Channel to Repeater (e.g. Channel to Repeater, ChannelBuffer to RepeaterBuffer). See #18 for the rationale behind this name c
Channel to Repeater (e.g. Channel to Repeater, ChannelBuffer to RepeaterBuffer). See #18 for the rationale behind this name change.Nothing published for this version
One column per quarter.