add hw2
This commit is contained in:
13
node_modules/pino/test/fixtures/to-file-transport.js
generated
vendored
Normal file
13
node_modules/pino/test/fixtures/to-file-transport.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict'
|
||||
|
||||
const fs = require('fs')
|
||||
const { once } = require('events')
|
||||
|
||||
async function run (opts) {
|
||||
if (!opts.destination) throw new Error('kaboom')
|
||||
const stream = fs.createWriteStream(opts.destination)
|
||||
await once(stream, 'open')
|
||||
return stream
|
||||
}
|
||||
|
||||
module.exports = run
|
||||
Reference in New Issue
Block a user