Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Jun 8, 2024 via pnpm

on-finished 2.4.1

Execute a callback when a request closes, finishes, or errors
Package summary
Share
0
issues
1
license
2
MIT
Package created
16 Aug 2014
Version published
22 Feb 2022
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
ee-first@1.1.1
on-finished@2.4.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of on-finished 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
ee-first1.1.12.67 kBMIT
prod

Visualizations

Frequently Asked Questions

What does on-finished do?

The on-finished npm package is designed to execute a callback when an HTTP request closes, finishes, or encounters an error. It's a Node.js module that can be used to efficiently manage events related to HTTP requests on your server.

How do you use on-finished?

The on-finished npm package can be easily installed using the npm install on-finished command. Once installed, it can be included in your Node.js project with the line of code var onFinished = require('on-finished').

To use on-finished, listeners are attached to requests or responses to listen for their conclusion, using onFinished(res, listener) for responses and onFinished(req, listener) for requests. An example of its usage is as follows:

var onFinished = require('on-finished')

var data = ''

req.setEncoding('utf8')
req.on('data', function (str) {
  data += str
})

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

The package also provides functions to test if a request or response has already finished. These are used like 'onFinished.isFinished(res)' or 'onFinished.isFinished(req)'.

Where are the on-finished docs?

Documentation for the on-finished npm package can be found directly in the readme file on the package's official GitHub page - https://github.com/jshttp/on-finished.git. This readme provides complete documentation on how to install and use the package, along with specifics of its API and some examples of its usage.