Skip to content

v2.0.0

Latest

Choose a tag to compare

@xobotyi xobotyi released this 16 Sep 13:06
· 17 commits to master since this release

2.0.0 (2026-09-16)

⚠ BREAKING CHANGES

  • type the payload and the YAML body as unknown
  • release a pool client through a callback
  • give every error of the library a code
  • name the returned job for what it is
  • rename the stats types
  • drop the beanstalk prefix from the protocol types
  • rename the client and pool option types
  • replace the protocol enums with const objects
  • declare object shapes as type aliases
  • type emitter events through EventEmitter generics
  • the package is ESM only, requires Node.js >= 24 and
    seals its entry points with an exports map.

The ES5 CommonJS build predates every supported Node.js release and
the Node10 resolution it relied on is removed from current
TypeScript. Compiling with module: NodeNext makes the emitted code
what Node.js runs unchanged, which is why every relative import now
carries its .js extension and type-only imports are marked as such.
The floor is 24 rather than 22 because 22 is in maintenance and only
gained require(esm) at 22.12, and because 24 is the first line with
native explicit resource management, which later work builds on; the
ESNext target keeps using from being downleveled.

Migration:

  1. Run on Node.js 24 or newer.
  2. Load the package with import or with require(); both work on
    Node.js 24.
  3. Import from the package root only; deep paths into dist are no
    longer reachable.

Features

  • add a response timeout that drops the connection (7c87439)
  • add the missing cmd-* counters to the stats type (0971299)
  • bound the dial with a connect timeout (4a7a1ec)
  • bound the wait for a client of the pool (9d2facf)
  • emit connect, close and error on the client (4808be1)
  • implement Symbol.asyncDispose on Connection, Client and PoolClient (6ba53f7)
  • publish as ES modules targeting Node.js 24 (5e517cb)

Bug Fixes

  • bound the reserve timeout and the kick bound (c087ece)
  • count the trailing CRLF of an empty response body (86c0664)
  • deps: bump brace-expansion from 2.0.1 to 2.1.4 (#742) (6b0357e)
  • deps: bump js-yaml from 4.1.0 to 4.3.2 (#741) (7888245)
  • deps: bump tar from 6.2.0 to 6.2.1 (#652) (9143b9f)
  • deps: bump undici from 5.28.3 to 5.28.4 (#643) (176479b)
  • deps: bump voidzero-dev/setup-vp from 1.19.0 to 1.20.0 (#748) (c061064)
  • deps: hold the changelog preset at the major the writer renders (f49f3fa)
  • drop the connection when a response body stops arriving (ff12303)
  • evict the pool client whose connection is gone (cc8b7eb)
  • hand out no client once a disconnect was requested (b50fc7a)
  • ignore removal of a node that already left the list (bc8bb44)
  • keep the instance id of stats a string (77c793d)
  • move the connection to closed when its socket dies (45b015d)
  • reject a non-integer priority, delay and ttr (c933c58)
  • reject a tube name that starts with a hyphen (ab891ee)
  • reject a USING response that carries no tube name (d2fc149)
  • reject malformed numeric response headers (aa5bce9)
  • reject the command in flight when the connection dies (3a2f293)
  • stop reading the response when a command is not sent (f3527c3)

Performance Improvements

  • concatenate the response body once (e3980f5)

Code Refactoring

  • declare object shapes as type aliases (d94de64)
  • drop the beanstalk prefix from the protocol types (54f562a)
  • give every error of the library a code (b6fde59)
  • name the returned job for what it is (cd9af89)
  • release a pool client through a callback (6a65272)
  • rename the client and pool option types (ac4fdf9)
  • rename the stats types (2baf4c5)
  • replace the protocol enums with const objects (d8e09e6)
  • type emitter events through EventEmitter generics (836c5b8)
  • type the payload and the YAML body as unknown (122c81e)