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.exists is being deprecated #4847

Closed
markstos opened this issue Jan 24, 2015 · 2 comments · Fixed by #5027
Closed

fs.exists is being deprecated #4847

markstos opened this issue Jan 24, 2015 · 2 comments · Fixed by #5027

Comments

@markstos
Copy link
Contributor

fs.exists is used a few places in the code base, but is being deprecated by node and io.js and is not recommended by the current official Node.js docs.

Alternatives include using fs.stat or just skipping the check, trying a file action, and handing the error if it doesn't exit.

Refactoring to avoid fs.exists now would provide a bit of future-proofing.

@ErisDS
Copy link
Member

ErisDS commented Jan 27, 2015

@markstos thanks for the headsup :)

I think the places where we use fs.exists (namely image storage) will need to switch to use fs.stat as the pre-check is used to generate a unique filename before saving.

@jxhn
Copy link
Contributor

jxhn commented Jan 28, 2015

I'm aware it's not super urgent but I wouldn't mind jumping in on this.

felixrieseberg added a commit to felixrieseberg/Ghost that referenced this issue Mar 17, 2015
Closes TryGhost#4847

- Replaces the deprecated fs.exists() with fs.stat(), in accordance with iojs & node.
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 a pull request may close this issue.

3 participants