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

Remove deprecated fs.exists #183

Closed
wants to merge 1 commit into from
Closed

Remove deprecated fs.exists #183

wants to merge 1 commit into from

Conversation

caub
Copy link
Contributor

@caub caub commented Nov 29, 2024

Close #141

Copy link
Collaborator

@rajeshgupta723 rajeshgupta723 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @caub , Please recheck.

  • fs.exists is deprecated, but we have fs.exitsSync() which is still supported by node JS.
  • Also, recursive flag has issues in few versions of Node like ver 9 or 10.
    Thanks!

@rajeshgupta723
Copy link
Collaborator

@caub please feel free to close this PR, thanks!

@caub
Copy link
Contributor Author

caub commented Nov 30, 2024

ok you're right, suggested here as welll: https://nodejs.org/en/learn/manipulating-files/working-with-folders-in-nodejs

The alternative for older nodejs could be try { fs.mkdirSync(dir) } catch(err) { if (err.code !== 'EEXIST') throw err } (https://stackoverflow.com/a/13544465, https://stackoverflow.com/a/24311711) but since your way is fine let's close

The original reporter shouldn't be using logs in prod and multiple instances anyway

@caub caub closed this Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants