Skip to main content

Built and signed on GitHub Actions

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
94%
Published
2 months ago (0.1.0)
function createWritable
createWritable<T>(fn: (chunk: T) => void | Promise<void>): WritableStream<T>

Creates a writable stream from a given write function. Every chunk written to the stream will be passed to the function.

Examples

Example 1

const logStream = createWritable(console.log);

Type Parameters

Parameters

fn: (chunk: T) => void | Promise<void>

The write function, that will be called for each chunk written to the stream

Return Type

A writable stream

Add Package

deno add jsr:@sgmonda/qfu

Import symbol

import { createWritable } from "@sgmonda/qfu";

---- OR ----

Import directly with a jsr specifier

import { createWritable } from "jsr:@sgmonda/qfu";

Add Package

npx jsr add @sgmonda/qfu

Import symbol

import { createWritable } from "@sgmonda/qfu";

Add Package

yarn dlx jsr add @sgmonda/qfu

Import symbol

import { createWritable } from "@sgmonda/qfu";

Add Package

pnpm dlx jsr add @sgmonda/qfu

Import symbol

import { createWritable } from "@sgmonda/qfu";

Add Package

bunx jsr add @sgmonda/qfu

Import symbol

import { createWritable } from "@sgmonda/qfu";