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

fix: replace fs.promises with util.promisify to suppress ExperimentalWarning on Node.js v10 #786

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

iiroj
Copy link
Member

@iiroj iiroj commented Jan 31, 2020

This PR fixes #785 by removing usages of fs.promises and instead wrapping the older individual callback methods of fs with util.promisify.

Apparently the Node.js LTS 10.X docs state that fs.promises is stable, but the ExperimentalWarning has only been removed in v12.

@iiroj iiroj requested a review from okonet January 31, 2020 06:55
@codecov
Copy link

codecov bot commented Jan 31, 2020

Codecov Report

Merging #786 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #786   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          13     13           
  Lines         486    494    +8     
  Branches      107    107           
=====================================
+ Hits          486    494    +8
Impacted Files Coverage Δ
lib/resolveGitRepo.js 100% <100%> (ø) ⬆️
lib/file.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bfbe6c...9c5b39e. Read the comment docs.

@iiroj iiroj merged commit f71c1c9 into master Jan 31, 2020
@iiroj iiroj deleted the remove-fs-promises branch January 31, 2020 07:07
@okonet
Copy link
Collaborator

okonet commented Jan 31, 2020

🎉 This PR is included in version 10.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@alexilyaev
Copy link
Contributor

@iiroj Thanks for the quick fix!

I'm curious, why not use something like fs-extra?
I mean, yes it's another dependency, but it provides quite a lot of value.

@iiroj
Copy link
Member Author

iiroj commented Feb 1, 2020

@alexilyaev thanks! The file operations we use are pretty simple and lib/file.js has basically only try/catch wrappers for the native Node.js methods.

We do use fs-extra as a devDependency to make testing easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

ExperimentalWarning: The fs.promises API is experimental
3 participants