Skip to content

Commit 84cebfc

Browse files
committed
Update: Use flush-write-stream for sink instead of readable-stream
1 parent 21ed5df commit 84cebfc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/sink.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var Writable = require('readable-stream/writable');
3+
var Writable = require('flush-write-stream');
44

55
function listenerCount(stream, evt) {
66
return stream.listeners(evt).length;
@@ -10,14 +10,17 @@ function hasListeners(stream) {
1010
return !!(listenerCount(stream, 'readable') || listenerCount(stream, 'data'));
1111
}
1212

13+
var sinkOptions = {
14+
objectMode: true,
15+
};
16+
17+
function sinker(file, enc, callback) {
18+
callback();
19+
}
20+
1321
function sink(stream) {
1422
var sinkAdded = false;
15-
var sinkStream = new Writable({
16-
objectMode: true,
17-
write: function(file, enc, callback) {
18-
callback();
19-
},
20-
});
23+
var sinkStream = new Writable(sinkOptions, sinker);
2124

2225
function addSink() {
2326
if (sinkAdded) {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"lodash.isequal": "^4.0.0",
3737
"merge-stream": "^1.0.0",
3838
"object-assign": "^4.0.0",
39-
"readable-stream": "^2.0.4",
4039
"strip-bom": "^2.0.0",
4140
"strip-bom-stream": "^1.0.0",
4241
"through2": "^2.0.0",

0 commit comments

Comments
 (0)