pino/file.js
Cangit bd2fb33597
chore: use node: imports (#2003)
* chore: use node: imports

* missing esm style import
2024-07-12 06:48:44 -04:00

13 lines
358 B
JavaScript

'use strict'
const pino = require('./pino')
const { once } = require('node:events')
module.exports = async function (opts = {}) {
const destOpts = Object.assign({}, opts, { dest: opts.destination || 1, sync: false })
delete destOpts.destination
const destination = pino.destination(destOpts)
await once(destination, 'ready')
return destination
}