Skip to content

Commit

Permalink
Use readable-stream instead of Duplexify
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Jun 20, 2022
1 parent 13c03fc commit 9698236
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions index.js
Expand Up @@ -2,7 +2,7 @@

const metadata = Symbol.for('pino.metadata')
const split = require('split2')
const duplexify = require('duplexify')
const { Duplex } = require('readable-stream')

module.exports = function build (fn, opts = {}) {
const parseLines = opts.parse === 'lines'
Expand Down Expand Up @@ -67,9 +67,7 @@ module.exports = function build (fn, opts = {}) {
// set it to null to not retain a reference to the promise
res = null
} else if (opts.enablePipelining && res) {
return duplexify(stream, res, {
objectMode: true
})
return Duplex.from({ writable: stream, readable: res, objectMode: true })
}

return stream
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/pinojs/pino-abstract-transport#readme",
"dependencies": {
"duplexify": "^4.1.2",
"readable-stream": "^4.0.0",
"split2": "^4.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 9698236

Please sign in to comment.