arrayify-stream
Advanced tools
Comparing version 1.0.0 to 2.0.0
24
index.js
@@ -1,12 +0,14 @@ | ||
module.exports = function(stream) { | ||
return new Promise(function(resolve, reject) { | ||
var array = []; | ||
stream.on('data', function(data) { | ||
array.push(data); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function promisifyEventEmitter(event, result) { | ||
return new Promise((resolve, reject) => { | ||
event.on('end', () => resolve(result)); | ||
event.on('error', reject); | ||
}); | ||
stream.on('error', reject); | ||
stream.on('end', function() { | ||
resolve(array); | ||
}); | ||
}); | ||
}; | ||
} | ||
function arrayifyStream(stream) { | ||
const array = []; | ||
return promisifyEventEmitter(stream.on('data', data => array.push(data)), array); | ||
} | ||
exports.default = arrayifyStream; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "arrayify-stream", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Converts a Node readable stream into an array", | ||
"keywords": [ | ||
"stream", | ||
"array", | ||
"readable stream" | ||
], | ||
"main": "index.js", | ||
"typings": "index", | ||
"repository": "git@github.com:rubensworks/arrayify-stream.js.git", | ||
"author": "Ruben Taelman <rubensworks@gmail.com>", | ||
"license": "MIT" | ||
"bugs": { | ||
"url": "https://github.com/rubensworks/arrayify-stream.js/issues" | ||
}, | ||
"homepage": "https://github.com/rubensworks/arrayify-stream.js#readme", | ||
"license": "MIT", | ||
"files": [ | ||
"index.d.ts", | ||
"index.js" | ||
], | ||
"pre-commit": [ | ||
"build", | ||
"test" | ||
], | ||
"devDependencies": { | ||
"@types/jest": "^27.4.0", | ||
"@typescript-eslint/eslint-plugin": "^5.12.0", | ||
"@typescript-eslint/parser": "^5.12.0", | ||
"asynciterator": "^3.2.1", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^8.9.0", | ||
"eslint-config-es": "^4.0.0", | ||
"eslint-import-resolver-typescript": "^2.5.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-extended": "^0.2.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jest": "^26.1.1", | ||
"eslint-plugin-mocha": "^10.0.3", | ||
"eslint-plugin-react": "^7.28.0", | ||
"eslint-plugin-react-hooks": "^4.3.0", | ||
"eslint-plugin-tsdoc": "^0.2.14", | ||
"eslint-plugin-unicorn": "37.0.1", | ||
"eslint-plugin-unused-imports": "^2.0.0", | ||
"jest": "^27.5.1", | ||
"manual-git-changelog": "^1.0.0", | ||
"pre-commit": "^1.2.2", | ||
"ts-jest": "^27.1.3", | ||
"typescript": "^4.5.5" | ||
}, | ||
"jest": { | ||
"globals": { | ||
"ts-jest": { | ||
"tsconfig": "test/tsconfig.json" | ||
} | ||
}, | ||
"transform": { | ||
"^.+\\.ts$": "ts-jest" | ||
}, | ||
"transformIgnorePatterns": [ | ||
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$" | ||
], | ||
"testRegex": "(/test/.*|(\\.|/)(test|spec))\\.ts$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js" | ||
], | ||
"collectCoverage": true, | ||
"testEnvironment": "node" | ||
}, | ||
"scripts": { | ||
"test": "jest ${1}", | ||
"test-watch": "jest ${1} --watch", | ||
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", | ||
"validate": "npm ls", | ||
"lint": "eslint index.ts test/**.ts ", | ||
"build": "tsc", | ||
"prepare": "npm run build", | ||
"version": "manual-git-changelog onversion" | ||
} | ||
} |
# Arrayify Stream | ||
[![Build status](https://github.com/rubensworks/arrayify-stream.js/workflows/CI/badge.svg)](https://github.com/rubensworks/arrayify-stream.js/actions?query=workflow%3ACI) | ||
[![Coverage Status](https://coveralls.io/repos/github/rubensworks/arrayify-stream.js/badge.svg?branch=master)](https://coveralls.io/github/rubensworks/arrayify-stream.js?branch=master) | ||
[![npm version](https://badge.fury.io/js/arrayify-stream.svg)](https://www.npmjs.com/package/arrayify-stream) | ||
@@ -4,0 +6,0 @@ |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5289
6
16
0
0
23
23