[Pkg-javascript-commits] [node-module-deps] 58/444: use concat-stream instead of on "data"/"end" for streams2 users
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:47:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit 776f5486a69b5f8112873b2ee125c143e1525f80
Author: James Halliday <mail at substack.net>
Date: Fri Mar 15 18:48:50 2013 -0700
use concat-stream instead of on "data"/"end" for streams2 users
---
index.js | 7 +++----
package.json | 5 +++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/index.js b/index.js
index eb23e09..f4dcf63 100644
--- a/index.js
+++ b/index.js
@@ -6,6 +6,7 @@ var browserResolve = require('browser-resolve');
var nodeResolve = require('resolve');
var detective = require('detective');
var through = require('through');
+var concatStream = require('concat-stream');
module.exports = function (mains, opts) {
if (!Array.isArray(mains)) mains = [ mains ].filter(Boolean);
@@ -82,12 +83,10 @@ module.exports = function (mains, opts) {
if (trs.length === 0) return done();
makeTransform(file, trs[0], function (s) {
s.on('error', output.emit.bind(output, 'error'));
- var data = '';
- s.on('data', function (buf) { data += buf });
- s.on('end', function () {
+ s.pipe(concatStream(function (err, data) {
src = data;
ap(trs.slice(1));
- });
+ }));
s.end(src);
});
})(transf);
diff --git a/package.json b/package.json
index 2a95db3..bfaa248 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "module-deps",
- "version": "0.5.1",
+ "version": "0.5.2",
"description": "walk the dependency graph to generate json output that can be fed into browser-pack",
"main": "index.js",
"bin": {
@@ -11,7 +11,8 @@
"JSONStream": "~0.4.3",
"browser-resolve": "~0.0.3",
"resolve": "~0.3.0",
- "detective": "~2.0.0"
+ "detective": "~2.0.0",
+ "concat-stream": "~0.1.1"
},
"devDependencies": {
"tap": "~0.4.0",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list