Skip to content

Commit

Permalink
Update: Use flush-write-stream for sink instead of readable-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 27, 2017
1 parent 7f56179 commit 64279f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
17 changes: 10 additions & 7 deletions lib/sink.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

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

function listenerCount(stream, evt) {
return stream.listeners(evt).length;
Expand All @@ -10,14 +10,17 @@ function hasListeners(stream) {
return !!(listenerCount(stream, 'readable') || listenerCount(stream, 'data'));
}

var sinkOptions = {
objectMode: true,
};

function sinker(file, enc, callback) {
callback();
}

function sink(stream) {
var sinkAdded = false;
var sinkStream = new Writable({
objectMode: true,
write: function(file, enc, callback) {
callback();
},
});
var sinkStream = new Writable(sinkOptions, sinker);

function addSink() {
if (sinkAdded) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"lodash.isequal": "^4.0.0",
"merge-stream": "^1.0.0",
"object-assign": "^4.0.0",
"readable-stream": "^2.0.4",
"strip-bom": "^2.0.0",
"strip-bom-stream": "^1.0.0",
"through2": "^2.0.0",
Expand Down

0 comments on commit 64279f2

Please sign in to comment.