Skip to content

fs: add openAsBlobSync - #65644

Open
greenheadHQ wants to merge 1 commit into
nodejs:mainfrom
greenheadHQ:feat/open-as-blob-sync
Open

fs: add openAsBlobSync#65644
greenheadHQ wants to merge 1 commit into
nodejs:mainfrom
greenheadHQ:feat/open-as-blob-sync

Conversation

@greenheadHQ

Copy link
Copy Markdown
Contributor

This adds fs.openAsBlobSync(path[, options]) as a synchronous counterpart to fs.openAsBlob(). For real-file paths, it returns the existing file-backed Blob directly while leaving the Promise-returning API unchanged; reading the Blob's contents remains lazy and asynchronous.

This follows up on #65462. 比较d with #49759, the change is additive: it does not modify fs.openAsBlob() or add an fs.promises alias.

Documentation is included. Tests cover supported path types and validation, file mutation detection, Permission Model denial, VFS mount ownership, and verify that fs.openAsBlob() still returns a Promise.

Disclosure: I used codex for research and some implementation work. I reviewed and thoroughly tested the changes myself.

Refs: #65462
Refs: #49759

Signed-off-by: greenhead <greenheadhq@gmail.com>
Assisted-by: Codex
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg
  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added fs 问题 and PRs related to file-system APIs and the fs module. lib / src 问题 and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. vfs 问题 and PRs related to the virtual filesystem subsystem. labels Aug 29, 2026
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

fs 问题 and PRs related to file-system APIs and the fs module. lib / src 问题 and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. vfs 问题 and PRs related to the virtual filesystem subsystem.

项目

None yet

Development

Successfully merging this pull request may close these issues.

2 participants