| 1 |
{ |
| 2 |
"_id": "destroy", |
| 3 |
"_rev": "15-67c674574129014022d2ef18d6bf3072", |
| 4 |
"name": "destroy", |
| 5 |
"time": { |
| 6 |
"modified": "2017-05-22T14:30:27.084Z", |
| 7 |
"created": "2013-10-03T17:12:42.209Z", |
| 8 |
"0.0.0": "2013-10-03T17:12:45.167Z", |
| 9 |
"1.0.3": "2014-08-15T06:30:06.962Z", |
| 10 |
"1.0.4": "2016-01-16T03:14:05.899Z" |
| 11 |
}, |
| 12 |
"maintainers": [ |
| 13 |
{ |
| 14 |
"email": "[email protected]", |
| 15 |
"name": "jongleberry" |
| 16 |
}, |
| 17 |
{ |
| 18 |
"email": "[email protected]", |
| 19 |
"name": "dougwilson" |
| 20 |
} |
| 21 |
], |
| 22 |
"dist-tags": { |
| 23 |
"latest": "1.0.4" |
| 24 |
}, |
| 25 |
"description": "destroy a stream if possible", |
| 26 |
"readme": "# Destroy\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Gittip][gittip-image]][gittip-url]\n\nDestroy a stream.\n\nThis module is meant to ensure a stream gets destroyed, handling different APIs\nand Node.js bugs.\n\n## API\n\n```js\nvar destroy = require('destroy')\n```\n\n### destroy(stream)\n\nDestroy the given stream. In most cases, this is identical to a simple\n`stream.destroy()` call. The rules are as follows for a given stream:\n\n 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()`\n and add a listener to the `open` event to call `stream.close()` if it is\n fired. This is for a Node.js bug that will leak a file descriptor if\n `.destroy()` is called before `open`.\n 2. If the `stream` is not an instance of `Stream`, then nothing happens.\n 3. If the `stream` has a `.destroy()` method, then call it.\n\nThe function returns the `stream` passed in as the argument.\n\n## Example\n\n```js\nvar destroy = require('destroy')\n\nvar fs = require('fs')\nvar stream = fs.createReadStream('package.json')\n\n// ... and later\ndestroy(stream)\n```\n\n[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/destroy\n[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square\n[github-url]: https://github.com/stream-utils/destroy/tags\n[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square\n[travis-url]: https://travis-ci.org/stream-utils/destroy\n[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master\n[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square\n[license-url]: LICENSE.md\n[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/destroy\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n", |
| 27 |
"versions": { |
| 28 |
"1.0.3": { |
| 29 |
"name": "destroy", |
| 30 |
"description": "destroy a stream if possible", |
| 31 |
"version": "1.0.3", |
| 32 |
"author": { |
| 33 |
"name": "Jonathan Ong", |
| 34 |
"email": "[email protected]", |
| 35 |
"url": "http://jongleberry.com" |
| 36 |
}, |
| 37 |
"contributors": [ |
| 38 |
{ |
| 39 |
"name": "Douglas Christopher Wilson", |
| 40 |
"email": "[email protected]" |
| 41 |
} |
| 42 |
], |
| 43 |
"license": "MIT", |
| 44 |
"repository": { |
| 45 |
"type": "git", |
| 46 |
"url": "https://github.com/stream-utils/destroy" |
| 47 |
}, |
| 48 |
"devDependencies": { |
| 49 |
"istanbul": "0", |
| 50 |
"mocha": "1" |
| 51 |
}, |
| 52 |
"scripts": { |
| 53 |
"test": "mocha --reporter spec", |
| 54 |
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", |
| 55 |
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" |
| 56 |
}, |
| 57 |
"files": [ |
| 58 |
"index.js" |
| 59 |
], |
| 60 |
"keywords": [ |
| 61 |
"stream", |
| 62 |
"streams", |
| 63 |
"destroy", |
| 64 |
"cleanup", |
| 65 |
"leak", |
| 66 |
"fd" |
| 67 |
], |
| 68 |
"gitHead": "50af95ece4a70202f9301bc3edc8f9fdbbad0f26", |
| 69 |
"bugs": { |
| 70 |
"url": "https://github.com/stream-utils/destroy/issues" |
| 71 |
}, |
| 72 |
"homepage": "https://github.com/stream-utils/destroy", |
| 73 |
"_id": "[email protected]", |
| 74 |
"_shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9", |
| 75 |
"_from": ".", |
| 76 |
"_npmVersion": "1.4.21", |
| 77 |
"_npmUser": { |
| 78 |
"name": "jongleberry", |
| 79 |
"email": "[email protected]" |
| 80 |
}, |
| 81 |
"maintainers": [ |
| 82 |
{ |
| 83 |
"name": "jongleberry", |
| 84 |
"email": "[email protected]" |
| 85 |
} |
| 86 |
], |
| 87 |
"dist": { |
| 88 |
"shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9", |
| 89 |
"tarball": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz" |
| 90 |
}, |
| 91 |
"directories": {} |
| 92 |
}, |
| 93 |
"1.0.4": { |
| 94 |
"name": "destroy", |
| 95 |
"description": "destroy a stream if possible", |
| 96 |
"version": "1.0.4", |
| 97 |
"author": { |
| 98 |
"name": "Jonathan Ong", |
| 99 |
"email": "[email protected]", |
| 100 |
"url": "http://jongleberry.com" |
| 101 |
}, |
| 102 |
"contributors": [ |
| 103 |
{ |
| 104 |
"name": "Douglas Christopher Wilson", |
| 105 |
"email": "[email protected]" |
| 106 |
} |
| 107 |
], |
| 108 |
"license": "MIT", |
| 109 |
"repository": { |
| 110 |
"type": "git", |
| 111 |
"url": "https://github.com/stream-utils/destroy" |
| 112 |
}, |
| 113 |
"devDependencies": { |
| 114 |
"istanbul": "0.4.2", |
| 115 |
"mocha": "2.3.4" |
| 116 |
}, |
| 117 |
"scripts": { |
| 118 |
"test": "mocha --reporter spec", |
| 119 |
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", |
| 120 |
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" |
| 121 |
}, |
| 122 |
"files": [ |
| 123 |
"index.js", |
| 124 |
"LICENSE" |
| 125 |
], |
| 126 |
"keywords": [ |
| 127 |
"stream", |
| 128 |
"streams", |
| 129 |
"destroy", |
| 130 |
"cleanup", |
| 131 |
"leak", |
| 132 |
"fd" |
| 133 |
], |
| 134 |
"gitHead": "86edea01456f5fa1027f6a47250c34c713cbcc3b", |
| 135 |
"bugs": { |
| 136 |
"url": "https://github.com/stream-utils/destroy/issues" |
| 137 |
}, |
| 138 |
"homepage": "https://github.com/stream-utils/destroy", |
| 139 |
"_id": "[email protected]", |
| 140 |
"_shasum": "978857442c44749e4206613e37946205826abd80", |
| 141 |
"_from": ".", |
| 142 |
"_npmVersion": "1.4.28", |
| 143 |
"_npmUser": { |
| 144 |
"name": "dougwilson", |
| 145 |
"email": "[email protected]" |
| 146 |
}, |
| 147 |
"maintainers": [ |
| 148 |
{ |
| 149 |
"name": "jongleberry", |
| 150 |
"email": "[email protected]" |
| 151 |
}, |
| 152 |
{ |
| 153 |
"name": "dougwilson", |
| 154 |
"email": "[email protected]" |
| 155 |
} |
| 156 |
], |
| 157 |
"dist": { |
| 158 |
"shasum": "978857442c44749e4206613e37946205826abd80", |
| 159 |
"tarball": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" |
| 160 |
}, |
| 161 |
"directories": {} |
| 162 |
} |
| 163 |
}, |
| 164 |
"homepage": "https://github.com/stream-utils/destroy", |
| 165 |
"keywords": [ |
| 166 |
"stream", |
| 167 |
"streams", |
| 168 |
"destroy", |
| 169 |
"cleanup", |
| 170 |
"leak", |
| 171 |
"fd" |
| 172 |
], |
| 173 |
"repository": { |
| 174 |
"type": "git", |
| 175 |
"url": "https://github.com/stream-utils/destroy" |
| 176 |
}, |
| 177 |
"contributors": [ |
| 178 |
{ |
| 179 |
"name": "Douglas Christopher Wilson", |
| 180 |
"email": "[email protected]" |
| 181 |
} |
| 182 |
], |
| 183 |
"author": { |
| 184 |
"name": "Jonathan Ong", |
| 185 |
"email": "[email protected]", |
| 186 |
"url": "http://jongleberry.com" |
| 187 |
}, |
| 188 |
"bugs": { |
| 189 |
"url": "https://github.com/stream-utils/destroy/issues" |
| 190 |
}, |
| 191 |
"license": "MIT", |
| 192 |
"readmeFilename": "README.md", |
| 193 |
"users": { |
| 194 |
"goodseller": true, |
| 195 |
"kankungyip": true, |
| 196 |
"mojaray2k": true, |
| 197 |
"chaoliu": true |
| 198 |
}, |
| 199 |
"_attachments": {} |
| 200 |
} |