Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
sgmonda/qfuThis package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers




JSR Score
94%
Published
4 months ago (0.1.0)
/** * Creates a writable stream from a given write function. Every chunk written to the stream will be passed to the function. * * @param fn The write function, that will be called for each chunk written to the stream * @returns A writable stream * * @example const logStream = createWritable(console.log); */ export const createWritable = <T>(fn: (chunk: T) => void | Promise<void>): WritableStream<T> => { return new WritableStream<T>({ write: fn }) }