Back to Explore

jshttp/on-finished

GitHub
1 watchersOpen source

Last release: 2/22/2022

This Node.js module runs a callback when an HTTP request or response closes, finishes, or errors. It is useful for cleanup tasks tied to request completion, such as closing open files or continuing after request data has been fully read.

Project status

  • The upstream repo appears to be at least intermittently maintained, with a last upstream push on 2026-05-20, but the most recent tagged updates are much older (latest shown is v2.4.1 in 2022).
  • Update cadence looks sparse, with releases in 2022 (v2.4.0, v2.4.1) and a much earlier release in 2015 (v2.3.0), suggesting a long-lived, low-change project.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v2.4.1

    2/22/2022

    Release 2.4.1 is a small patch release that targets an error occurring with early or partially implemented Node.js async_hooks. The code change adjusts the async resource wrapping logic to be more defensive, and the CI workflow expands test coverage to include Node.js 8.0.

  • v2.4.0

    2/21/2022

    Release 2.4.0 focuses on preserving async hooks context by wrapping the on-finished callback using Node's async_hooks AsyncResource when it is attached to the response. The diff also updates repository tooling (linting, CI, and test coverage tooling) and refreshes some documentation and tests to cover async hooks behavior.

    Features
  • v2.3.0

    5/27/2015

    Release 2.3.0 defines how on-finished behaves for HTTP CONNECT and HTTP Upgrade requests, and updates related documentation and tests to codify that behavior. It also bumps the ee-first dependency from 1.1.0 to 1.1.1.

    Features
  • v2.2.1

    4/23/2015

    Release v2.2.1 updates the request lifecycle detection logic so `isFinished(req)` behaves correctly when request data is buffered. Alongside this, the project bumps some development dependencies and updates CI configuration.

  • v2.2.0

    12/23/2014

    Release v2.2.0 updates the on-finished callback behavior so the callback receives the underlying request or response object in addition to the error. Code changes show the internal callback invocation logic was updated for both the “already finished” and “later finished” cases.

    BreakingFeatures
  • v2.1.1

    10/23/2014

    Release 2.1.1 is described as a fix for handling pipelined requests. The code changes include a refactor of how the library determines when an HTTP message is finished, plus special handling for socket assignment (notably for older Node versions).

  • v2.1.0

    8/17/2014

    Release v2.1.0 adjusts how completion is detected for HTTP request/response objects. It updates `isFinished` to return `undefined` when it cannot determine state, and it improves handling around detached sockets.

    Breaking
  • v2.0.0

    8/17/2014

    Release 2.0.0 introduces the new `isFinished` function and broadens the API so handlers can accept both `req` and `res` arguments. It also includes several potentially disruptive changes, including renaming the package to `on-finished`, moving the project to the `jshttp` organization, and removing support for passing a plain socket argument.

    BreakingFeatures