Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node compatible file system #14

Closed
idoros opened this issue Mar 6, 2019 · 0 comments · Fixed by #15
Closed

Node compatible file system #14

idoros opened this issue Mar 6, 2019 · 0 comments · Fixed by #15
Labels
enhancement New feature or request

Comments

@idoros
Copy link
Contributor

idoros commented Mar 6, 2019

I completely agree with the promises over callbacks approach this lib is taking, However, the current FS Node API is still callback based with an experimental promises API. This makes it difficult to work with 3rd party libraries, like Webpack.

I wonder what you think about being closer to the spec and offering a callback version of the FS. Even with a subset of the node FS, just returning the callbacks would make this work.

There is no need to add overhead to the existing FS implementation. Just a compatible implementation to the node spec; adding the experimental .promises API would make it perfect 😉

FYI - from what I saw Webpack uses the current node FS API for readFile, writeFile, stat, rmdir, unlink, purge (optional), readlink (when resolve.symlinks is not turned off) while also requiring mkdirp and join directly on the FS API for some reason (webpack-dev-middleware even validates it)

AviVahl added a commit that referenced this issue Mar 11, 2019
- Drop node 8 support.
- Exposes all promise-based API under `promises` field (matches Node 10+).
- Node package uses Node 10's native `promises` API instead of promisifying them every time via `proper-fs`.
- Callback-style API is now exposed as well from async file systems.
- `readlink` (promise and callback style) and `readlinkSync` is now exposed as well, for better compatibility with libraries expecting Node-style API.

closes #14
@AviVahl AviVahl added the enhancement New feature or request label Mar 11, 2019
idoros pushed a commit to idoros/file-services that referenced this issue May 1, 2019
- Drop node 8 support.
- Exposes all promise-based API under `promises` field (matches Node 10+).
- Node package uses Node 10's native `promises` API instead of promisifying them every time via `proper-fs`.
- Callback-style API is now exposed as well from async file systems.
- `readlink` (promise and callback style) and `readlinkSync` is now exposed as well, for better compatibility with libraries expecting Node-style API.

closes wixplosives#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants