stream-promise
Advanced tools
Comparing version
30
index.js
@@ -1,23 +0,15 @@ | ||
'use strict'; | ||
var Writable = require('io-stream').Writable; | ||
var Promise = global.Promise || require('lie'); | ||
var inherits = require('inherits'); | ||
"use strict"; | ||
module.exports = StreamPromise; | ||
const Stream = require("stream"); | ||
inherits(StreamPromise, Writable); | ||
function StreamPromise() { | ||
if (!(this instanceof StreamPromise)) { | ||
return new StreamPromise(); | ||
} | ||
Writable.call(this, { | ||
objectMode: true | ||
}); | ||
class StreamEmitter extends Promise { | ||
constructor(executor) { | ||
super(executor); | ||
Stream.call(this); | ||
} | ||
} | ||
StreamPromise.prototype._write = function (chunk, _, next) { | ||
Promise.resolve(chunk).then(function () { | ||
next(); | ||
}, next); | ||
}; | ||
const EventEmitterPrototype = Object.getPrototypeOf(Stream.prototype); | ||
Object.assign(StreamEmitter.prototype, EventEmitterPrototype, Stream.prototype); | ||
module.exports = StreamEmitter; |
{ | ||
"name": "stream-promise", | ||
"version": "1.0.0", | ||
"description": "writable stream which resolves promises", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node test.js | tspec" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/calvinmetcalf/stream-promise.git" | ||
}, | ||
"version": "2.0.0", | ||
"description": "Promise that shares Node.js Stream interface", | ||
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)", | ||
"keywords": [ | ||
"promise", | ||
"stream", | ||
"promise" | ||
"emitter", | ||
"event-emitter" | ||
], | ||
"author": "Calvin W. Metcalf <calvin.metcalf@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/calvinmetcalf/stream-promise/issues" | ||
}, | ||
"homepage": "https://github.com/calvinmetcalf/stream-promise#readme", | ||
"repository": "medikoo/stream-promise", | ||
"devDependencies": { | ||
"tap-spec": "^4.0.0", | ||
"tape": "^4.0.0" | ||
"chai": "^4.2", | ||
"eslint": "^5.12", | ||
"eslint-config-medikoo": "^2", | ||
"mocha": "^5.2", | ||
"nyc": "^13.1" | ||
}, | ||
"dependencies": { | ||
"inherits": "^2.0.1", | ||
"io-stream": "^2.0.2", | ||
"lie": "^2.9.1" | ||
} | ||
"eslintConfig": { | ||
"extends": "medikoo", | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": "test/**/*.js", | ||
"env": { | ||
"mocha": true | ||
} | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"coverage": "nyc --reporter=lcov --reporter=html --reporter=text-summary npm test", | ||
"check-coverage": "npm run coverage && nyc check-coverage --statements 80 --function 80 --branches 50 --lines 80", | ||
"lint": "eslint --ignore-path=.gitignore .", | ||
"test": "mocha \"test/**.js\"" | ||
}, | ||
"license": "ISC" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4927
164.75%0
-100%7
75%49
444.44%5
150%36
-7.69%2
100%1
Infinity%1
Infinity%1
Infinity%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed