Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promise-readable

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-readable - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

10

CHANGELOG.md
# Changelog
## v4.1.0 2019-05-09
* Some changes for visibility of properties.
## v4.0.1 2019-05-09
* Updated dependencies.
## v4.0.0 2019-05-09
* Rewritten in Typescript.
* `PromiseReadable` accepts `NodeJS.ReadableStream`.
* `PromiseReadable` constructor accepts `NodeJS.ReadableStream`.
* Dropped support for Node < 6.

@@ -8,0 +16,0 @@

5

lib/promise-readable.d.ts

@@ -0,1 +1,2 @@

/// <reference types="node" />
interface ReadableStream extends NodeJS.ReadableStream {

@@ -8,3 +9,5 @@ closed?: boolean;

readonly stream: TReadable;
private errorHandler;
static [Symbol.hasInstance](instance: any): boolean;
readonly isPromiseReadable: boolean;
private readonly errorHandler?;
private errored?;

@@ -11,0 +14,0 @@ constructor(stream: TReadable);

@@ -7,2 +7,3 @@ "use strict";

this.stream = stream;
this.isPromiseReadable = true;
this.errorHandler = (err) => {

@@ -13,2 +14,5 @@ this.errored = err;

}
static [Symbol.hasInstance](instance) {
return instance.isPromiseReadable;
}
read(size) {

@@ -118,3 +122,2 @@ const stream = this.stream;

this.stream.removeListener('error', this.errorHandler);
delete this.errorHandler;
}

@@ -121,0 +124,0 @@ if (typeof this.stream.destroy === 'function') {

{
"name": "promise-readable",
"version": "4.0.0",
"version": "4.1.0",
"description": "Return promise for readable stream",

@@ -29,3 +29,4 @@ "main": "lib/promise-readable.js",

"@types/mocha": "^5.2.6",
"@types/node": "^9.4.7",
"@types/node": "^12.0.0",
"@types/semver": "^6.0.0",
"chai": "^4.2.0",

@@ -41,8 +42,8 @@ "coveralls": "^3.0.3",

"prettier": "^1.17.0",
"semver": "^6.0.0",
"shx": "^0.3.2",
"ts-node": "^8.1.0",
"tslint": "^5.9.1",
"tslint": "^5.16.0",
"tslint-config-prettier": "^1.18.0",
"tslint-config-standard": "^7.0.0",
"typescript": "^2.7.2"
"typescript": "^3.4.5"
},

@@ -49,0 +50,0 @@ "scripts": {

@@ -10,3 +10,9 @@ /// <reference types="node" />

export class PromiseReadable<TReadable extends ReadableStream> {
private errorHandler: (err: Error) => void
static [Symbol.hasInstance](instance: any): boolean {
return instance.isPromiseReadable
}
readonly isPromiseReadable: boolean = true
private readonly errorHandler?: (err: Error) => void
private errored?: Error

@@ -147,3 +153,2 @@

this.stream.removeListener('error', this.errorHandler)
delete this.errorHandler
}

@@ -150,0 +155,0 @@ if (typeof this.stream.destroy === 'function') {

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