@ende/io

ende add jsr:@ende/io

Version 2026.10.15 on JSR.

Utilities for working with Ende's readers, writers, and web streams.

Reader and Writer interfaces are deprecated in Ende, and so many of these utilities are also deprecated. Consider using web streams instead.

import { toReadableStream, toWritableStream } from "@ende/io";

await toReadableStream(Ende.stdin)
  .pipeTo(toWritableStream(Ende.stdout));

Modules

Exports

  • Buffer — A variable-sized buffer of bytes with `read()` and `write()` methods.
  • Closer — An abstract interface which when implemented provides an interface to close files/resources that were previously opened.
  • copy — Copies from `src` to `dst` until either EOF (`null`) is read from `src` or an error occurs. It resolves to the number of bytes copied or rejects with the first error encountered while copying.
  • iterateReader — Turns a Reader into an async iterator.
  • iterateReaderSync — Turns a ReaderSync into an iterator.
  • readAll — Read Reader `r` until EOF (`null`) and resolve to the content as Uint8Array.
  • readAllSync — Synchronously reads ReaderSync `r` until EOF (`null`) and returns the content as Uint8Array.
  • Reader — An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.
  • readerFromStreamReader — Create a Reader from a ReadableStreamDefaultReader.
  • ReaderSync — An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.
  • Seeker — An abstract interface which when implemented provides an interface to seek within an open file/resource asynchronously.
  • SeekerSync — An abstract interface which when implemented provides an interface to seek within an open file/resource synchronously.
  • SeekMode — A enum which defines the seek mode for IO related APIs that support seeking.
  • toReadableStream — Create a ReadableStream of Uint8Arrays from a Reader.
  • ToReadableStreamOptions — Options for toReadableStream.
  • toWritableStream — Create a WritableStream from a Writer.
  • toWritableStreamOptions — Options for toWritableStream.
  • writeAll — Write all the content of the array buffer (`arr`) to the writer (`w`).
  • writeAllSync — Synchronously write all the content of the array buffer (`arr`) to the writer (`w`).
  • Writer — An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.
  • WriterSync — An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.