Files
mmpSearch/node_modules/thread-stream/test/ts/to-file.ts
T
2025-10-26 16:43:01 -03:00

11 lines
286 B
TypeScript

import { type PathLike, type WriteStream, createWriteStream } from 'fs'
import { once } from 'events'
export default async function run (
opts: { dest: PathLike },
): Promise<WriteStream> {
const stream = createWriteStream(opts.dest)
await once(stream, 'open')
return stream
}