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

fs Promises API #160

Open
ysulyma opened this issue Apr 29, 2019 · 4 comments · May be fixed by #173
Open

fs Promises API #160

ysulyma opened this issue Apr 29, 2019 · 4 comments · May be fixed by #173

Comments

@ysulyma
Copy link

ysulyma commented Apr 29, 2019

Are there plans include a graceful version of the fs Promises API in this package? This was experimental for a while but is considered a stable feature in the latest version of Node.

coreyfarrell added a commit to coreyfarrell/node-graceful-fs that referenced this issue Aug 4, 2019
This support is dependent on `util.promisify` existing, so node.js 8+.

Fixes isaacs#160
@alexander-akait
Copy link

/cc @isaacs friendly ping

@zachleat
Copy link

Maybe helpful for folks I used the built-in util.promisify with this package and it worked great

const fs = require("graceful-fs");
const util = require("util");
const writeFile = util.promisify(fs.writeFile);

@strafe
Copy link

strafe commented Aug 9, 2022

So this package isn't a drop-in replacement for fs then?

@Frikster
Copy link

fs-extra has promises and uses graceful-fs under the hood. A third-party library fixing and using a third-party one that fixes a native one.

fs-extra adds file system methods that aren't included in the native fs module and adds promise support to the fs methods. It also uses graceful-fs to prevent EMFILE errors. It should be a drop in replacement for fs.

Stay tuned and soon there will be a problem with fs-extra that means it will cease to be a drop in replacement for fs . So then we'll need a third-party library that fixes and uses a third-party library that fixes and uses a third-party library to fix fs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants