Skip to content

Add fs/promises and FileHandle externs - #215

Merged
kevinresol merged 3 commits into
HaxeFoundation:masterfrom
kevinresol:feat/fs-promises
Jul 14, 2026
Merged

Add fs/promises and FileHandle externs#215
kevinresol merged 3 commits into
HaxeFoundation:masterfrom
kevinresol:feat/fs-promises

Conversation

@kevinresol

Copy link
Copy Markdown
Contributor

Summary

  • Add js.node.FsPromises (@:jsRequire("fs/promises")) mirroring callback Fs APIs as Promise-returning statics
  • Add js.node.fs.FileHandle for the handle returned by FsPromises.open
  • Reuse existing Fs typedefs (FsPath, options, Stats, Dir, etc.); no reshuffling of existing modules

Test plan

  • haxe build.hxml succeeds
  • Spot-check against Node 24 fs/promises: access, readFile, writeFile, open/FileHandle, glob, watch
  • Confirm skipped APIs are intentional: mkdtempDisposable, FileHandle.readableWebStream, Symbol.asyncDispose

Made with Cursor

kevinresol and others added 3 commits July 13, 2026 23:54
Expose Node's promise-based filesystem API as thin wrappers over existing Fs typedefs, including the FileHandle class returned by open().

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop invalid @:jsRequire for FileHandle, add readableWebStream, and use js.node.web.AbortSignal for watch options.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol merged commit 66e5c57 into HaxeFoundation:master Jul 14, 2026
10 checks passed
@kevinresol
kevinresol deleted the feat/fs-promises branch July 15, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant