stream.finished
Advanced tools
Comparing version 1.1.2 to 1.2.0
# Changelog | ||
## v1.2.0 2019-05-08 | ||
* Support for promisify in Typescript. | ||
## v1.1.2 2019-05-08 | ||
@@ -4,0 +8,0 @@ |
@@ -7,11 +7,12 @@ /// <reference types="node" /> | ||
stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, | ||
callback: (err?: NodeJS.ErrnoException) => void | ||
callback: (err?: NodeJS.ErrnoException | null) => void | ||
): () => void; | ||
declare namespace finished { | ||
export function getPolyfill(): typeof finished; | ||
export const implementation: typeof finished; | ||
export function shim(): typeof finished; | ||
function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream): Promise<void>; | ||
function getPolyfill(): typeof finished; | ||
const implementation: typeof finished; | ||
function shim(): typeof finished; | ||
} | ||
export = finished; |
{ | ||
"name": "stream.finished", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Polyfill/shim for stream.finished in node versions < v10", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,2 +20,14 @@ # stream.finished | ||
## Installation | ||
```shell | ||
npm install stream.finished | ||
``` | ||
_Additionally for Typescript:_ | ||
```shell | ||
npm install -D @types/node | ||
``` | ||
## Usage | ||
@@ -30,2 +42,9 @@ | ||
_Typescript:_ | ||
```ts | ||
import finished from 'stream.finished'; | ||
// Use `finished` just like the built-in method on `stream` | ||
``` | ||
### Shim | ||
@@ -48,1 +67,30 @@ | ||
``` | ||
_Typescript:_ | ||
```js | ||
import finishedShim from 'stream.finished/shim'; | ||
finishedShim(); | ||
// `stream.finished` is now defined | ||
import stream from 'stream'; | ||
// Use `stream.finished` | ||
``` | ||
or: | ||
```js | ||
import 'stream.finished/auto'; | ||
// `stream.finished` is now defined | ||
import stream from 'stream'; | ||
// Use `stream.finished` | ||
``` | ||
## License | ||
Copyright (c) 2018-2019 Piotr Roszatycki <piotr.roszatycki@gmail.com> | ||
Copyright Node.js contributors. All rights reserved. | ||
Copyright (c) 2014 Mathias Buus | ||
[MIT](https://opensource.org/licenses/MIT) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10542
166
94