on-finished reliably executes a callback function when a stream closes, finishes, or errors. It provides a consistent, cross-platform mechanism for detecting stream completion, regardless of the underlying event. This utility is crucial for resource cleanup, logging, or performing actions after a stream's data transfer is complete. By handling various stream termination scenarios, on-finished promotes robust and predictable application behavior, ensuring your code gracefully handles stream events.
The npm package "on-finished" has seen sporadic releases. Initial activity in 2014 and 2015, with occasional releases. There was a long period of inactivity between May 2015 and February 2022. In February 2022, there were two releases, but since then, no new versions have been published as of September 2025. The package appears to be mostly unmaintained in recent years.
On-finished npm package downloads show a generally increasing trend from March 2024 to August 2025, peaking in July 2025 at 257 million. September 2025 downloads are significantly lower, but the month is not yet complete. The package consistently sees over 100 million downloads monthly.