Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/tools/deps/proc.ts>buffer

A better way to work with processes in Deno.
Latest
function buffer
Re-export
import { buffer } from "https://deno.land/x/proc@0.22.1/tools/deps/proc.ts";

Transformer that conditionally adds buffering to a Uint8Array stream.

This enforces that the size of the passed data is at least size. Note that data is never reduced in size. It is either passed through unchanged (if it is big enough already) or held and concatenated with the next data until it there is enough data to write through.

If size is 0 or negative, the input data is passed through without buffering.

You do not normally need to use this transform directly as you can turn on input buffering with a parameter to the run method or function.

Parameters

optional
size = [UNSUPPORTED]

Returns

TransformerFunction<Uint8Array, Uint8Array>