diff --git a/bin.js b/bin.js index d9d23ae..80c0646 100644 --- a/bin.js +++ b/bin.js @@ -6,7 +6,7 @@ const help = require('help-me')({ dir: path.join(__dirname, 'help'), ext: '.txt' }) -const pump = require('pump') +const { pipeline } = require('stream') const sjp = require('secure-json-parse') const JoyCon = require('joycon') const stripJsonComments = require('strip-json-comments') @@ -79,7 +79,7 @@ if (cmd.h || cmd.help) { opts.errorProps = opts.errorProps || '' const res = build(opts) - pump(process.stdin, res) + pipeline(process.stdin, res, () => {}) // https://github.com/pinojs/pino/pull/358 /* istanbul ignore next */ diff --git a/index.js b/index.js index 2d76def..d34c194 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,7 @@ 'use strict' const { isColorSupported } = require('colorette') -const pump = require('pump') -const { Transform } = require('readable-stream') +const { Transform, pipeline: pump } = require('node:stream') const abstractTransport = require('pino-abstract-transport') const colors = require('./lib/colors') const { @@ -169,7 +168,7 @@ function build (opts = {}) { destination.write(line + '\n') }) - pump(source, stream, destination) + pump(source, stream, destination, () => {}) return stream }, { parse: 'lines' }) } diff --git a/package.json b/package.json index 2933b7c..b89f727 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,6 @@ "minimist": "^1.2.6", "on-exit-leak-free": "^2.1.0", "pino-abstract-transport": "^1.0.0", - "pump": "^3.0.0", - "readable-stream": "^4.0.0", "secure-json-parse": "^2.4.0", "sonic-boom": "^4.0.1", "strip-json-comments": "^3.1.1"