cross-org / fs

Cross Runtime (Deno, Node, Bun) filesystem operations for JavaScript and TypeScript
MIT License
4 stars 0 forks source link

Missing `*Sync` synchronous functions #1

Open EthanThatOneKid opened 5 months ago

EthanThatOneKid commented 5 months ago

Is it within the scope of this project to expose the synchronous versions of the fs functions?

Hexagon commented 5 months ago

I see the *Sync as a legacy from the past, to simplify callback/promise-hell before async/await (and top level await) arrived etc. But If there are good use cases, we should of course include them :+1:

EthanThatOneKid commented 5 months ago

Accessing these functions in synchronous contexts can still be convenient in some situations. Could the *Sync functions be exported by a separate repository to prevent clutter in @cross/fs?

Whether or not *Sync becomes part of @cross, I'm curious if we can achieve the same cross-runtime support on jsr.io importing from node:fs.

Hexagon commented 5 months ago

@EthanThatOneKid Yep, *Sync from node:fs seems to be working fine in all of Node, Deno and Bun 👍