-
Notifications
You must be signed in to change notification settings - Fork 365
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
chore: remove unnecessary abstractions of filesystem functions #5320
Conversation
import execa from 'execa' | ||
import getPort from 'get-port' | ||
import verdaccio from 'verdaccio' | ||
|
||
// TODO: remove this once `../../src/lib/fs.js` is an esm module as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know why we should wait, ESM can import commonjs
@@ -1,22 +1,15 @@ | |||
import { appendFileSync, existsSync, promises, readFileSync, writeFileSync } from 'fs' | |||
import { appendFile, mkdtemp, readFile, rm, writeFile } from 'fs/promises' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this file to use async version of the fs functions.
📊 Benchmark resultsComparing with 6102e77 Package size: 249 MB⬇️ 0.00% decrease vs. 6102e77
Legend
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
Summary
Both
readFileAsyncCatchError
andrmdirRecursiveAsync
fromsrc/lib/fs.cjs
can be replaced with node builtin functionality now that we dropped node 12.