Skip to main content

@std/io@0.225.0

UNSTABLE: The utilities for advanced I/O operations using Reader and Writer interfaces.

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether 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
88%
Published
a month ago (0.225.0)
function writeAll
writeAll(
writer: Writer,
data: Uint8Array,
): Promise<void>

Write all the content of the array buffer (arr) to the writer (w).

Examples

Writing to stdout

import { writeAll } from "@std/io/write-all";

const contentBytes = new TextEncoder().encode("Hello World");
await writeAll(Deno.stdout, contentBytes);

Writing to file

import { writeAll } from "@std/io/write-all";

const contentBytes = new TextEncoder().encode("Hello World");
using file = await Deno.open('test.file', { write: true });
await writeAll(file, contentBytes);

Parameters

writer: Writer

The writer to write to

The data to write

Return Type

Promise<void>

Add Package

deno add jsr:@std/io

Import symbol

import { writeAll } from "@std/io";

---- OR ----

Import directly with a jsr specifier

import { writeAll } from "jsr:@std/io";

Add Package

npx jsr add @std/io

Import symbol

import { writeAll } from "@std/io";

Add Package

yarn dlx jsr add @std/io

Import symbol

import { writeAll } from "@std/io";

Add Package

pnpm dlx jsr add @std/io

Import symbol

import { writeAll } from "@std/io";

Add Package

bunx jsr add @std/io

Import symbol

import { writeAll } from "@std/io";