@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
19 lines • 596 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("stream");
/**
* Use as a "null-terminator" of stream.pipeline.
* It consumes the stream as quickly as possible without doing anything.
* Put it in the end of your pipeline in case it ends with Transform that needs a consumer.
*/
function writableVoid(opt) {
return new stream_1.Writable({
objectMode: true,
...opt,
write(chunk, _encoding, cb) {
cb();
},
});
}
exports.writableVoid = writableVoid;
//# sourceMappingURL=writableVoid.js.map