Socket
Socket
Sign inDemoInstall

on-finished

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

on-finished - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

5

HISTORY.md

@@ -0,1 +1,6 @@

2.2.0 / 2014-12-22
==================
* Add message object to callback arguments
2.1.1 / 2014-10-22

@@ -2,0 +7,0 @@ ==================

4

index.js

@@ -42,3 +42,3 @@ /*!

if (isFinished(msg) !== false) {
defer(listener)
defer(listener, null, msg)
return msg

@@ -165,3 +165,3 @@ }

for (var i = 0; i < queue.length; i++) {
queue[i](err)
queue[i](err, msg)
}

@@ -168,0 +168,0 @@ }

{
"name": "on-finished",
"description": "Execute a callback when a request closes, finishes, or errors",
"version": "2.1.1",
"version": "2.2.0",
"contributors": [

@@ -15,4 +15,4 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>",

"devDependencies": {
"istanbul": "0.3.2",
"mocha": "~2.0.0"
"istanbul": "0.3.5",
"mocha": "~2.0.1"
},

@@ -19,0 +19,0 @@ "engines": {

@@ -27,3 +27,4 @@ # on-finished

be invoked only once when the response finished. If the response finished
to to an error, the first argument will contain the error.
to to an error, the first argument will contain the error. If the response
has already finished, the listener will be invoked.

@@ -33,5 +34,8 @@ Listening to the end of a response would be used to close things associated

Listener is invoked as `listener(err, res)`.
```js
onFinished(res, function (err) {
onFinished(res, function (err, res) {
// clean up open fds, etc.
// err contains the error is request error'd
})

@@ -44,3 +48,4 @@ ```

be invoked only once when the request finished. If the request finished
to to an error, the first argument will contain the error.
to to an error, the first argument will contain the error. If the request
has already finished, the listener will be invoked.

@@ -50,2 +55,4 @@ Listening to the end of a request would be used to know when to continue

Listener is invoked as `listener(err, req)`.
```js

@@ -59,3 +66,3 @@ var data = ''

onFinished(req, function (err) {
onFinished(req, function (err, req) {
// data is read unless there is err

@@ -62,0 +69,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc