Skip to main content

@fuman/io@0.0.10
Built and signed on GitHub Actions

It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether 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
58%
Published
a month ago (0.0.10)
class Bytes

a byte buffer implementing fuman readable/writable streams

Constructors

new
Bytes(buf: Uint8Array)

Properties

Number of bytes available to be read

readonly
capacity: number

Total number of bytes in the underlying buffer

readonly
written: number

Number of bytes written

Methods

disposeWriteSync(written?: number): void
reclaim(): void

Reclaim memory by only keeping the yet-unread data

reset(): void

reset the read/write cursors

get the "result" of the buffer, i.e. everything that has been written so far, but not yet read

Note: this method returns a view into the underlying buffer, and does advance the read cursor

rewind(n: number): void

Mark last n bytes as unread

write(bytes: Uint8Array): Promise<void>

Static Methods

Add Package

deno add jsr:@fuman/io

Import symbol

import { Bytes } from "@fuman/io";

---- OR ----

Import directly with a jsr specifier

import { Bytes } from "jsr:@fuman/io";

Add Package

npx jsr add @fuman/io

Import symbol

import { Bytes } from "@fuman/io";

Add Package

yarn dlx jsr add @fuman/io

Import symbol

import { Bytes } from "@fuman/io";

Add Package

pnpm dlx jsr add @fuman/io

Import symbol

import { Bytes } from "@fuman/io";

Add Package

bunx jsr add @fuman/io

Import symbol

import { Bytes } from "@fuman/io";