<commit_before># finished

[![NPM Version](https://badge.fury.io/js/finished.svg)](http://badge.fury.io/js/finished)
[![Build Status](https://travis-ci.org/expressjs/finished.svg?branch=master)](https://travis-ci.org/expressjs/finished)
[![Coverage Status](https://img.shields.io/coveralls/expressjs/finished.svg?branch=master)](https://coveralls.io/r/expressjs/finished)

Execute a callback when a request closes, finishes, or errors.

#### Install

`npm install finished`

#### Uses

This is useful for cleaning up streams. For example, you want to destroy any file streams you create on socket errors otherwise you will leak file descriptors.

This is required to fix what many perceive as issues with node's streams. Relevant:

- [node#6041](https://github.com/joyent/node/issues/6041)<commit_msg>docs: update format of install<commit_after># finished

[![NPM Version](https://badge.fury.io/js/finished.svg)](http://badge.fury.io/js/finished)
[![Build Status](https://travis-ci.org/expressjs/finished.svg?branch=master)](https://travis-ci.org/expressjs/finished)
[![Coverage Status](https://img.shields.io/coveralls/expressjs/finished.svg?branch=master)](https://coveralls.io/r/expressjs/finished)

Execute a callback when a request closes, finishes, or errors.

#### Install

```sh
$ npm install finished
```

#### Uses

This is useful for cleaning up streams. For example, you want to destroy any file streams you create on socket errors otherwise you will leak file descriptors.

This is required to fix what many perceive as issues with node's streams. Relevant:

- [node#6041](https://github.com/joyent/node/issues/6041)
{'fraction_non_alphanumeric': 0.143646408839779, 'fraction_numerical': 0.009821976672805401, 'mean_word_length': 5.221374045801527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4251791', 'n_tokens_mistral': 522, 'n_tokens_neox': 492, 'n_words': 134}