Skip to content

Byte stream support for FileHandle::readableWebStream #45853

Description

@saschanaz

What is the problem this feature will solve?

This fails currently:

(await fs.open("./test/animated/87a.gif")).readableWebStream().getReader({mode:'byob'})
Uncaught:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'stream' must be a byte stream. Received ReadableStream { locked: false, state: 'readable', supportsBYOB: false }
    at __node_internal_captureLargerStackTrace (node:internal/errors:484:5)
    at new NodeError (node:internal/errors:393:5)
    at setupReadableStreamBYOBReader (node:internal/webstreams/readablestream:2127:11)
    at new ReadableStreamBYOBReader (node:internal/webstreams/readablestream:882:5)
    at ReadableStream.getReader (node:internal/webstreams/readablestream:323:12)
    at REPL276:1:96 {
  code: 'ERR_INVALID_ARG_VALUE'
}

But a file is all about bytes and intuitively it should succeed.

What is the feature you are proposing to solve the problem?

Byte stream support for FileHandle::readableWebStream

What alternatives have you considered?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions