pkg
pkg copied to clipboard
feat: use native node fs
There's still a test case where it requires fs-extra
, so I'm not sure if we can completely remove the package, but at least we can move it out of the dependency tree.
The rationale for replacing those async methods is because it's immediately await
-ed and used — e.g., it's executed as (await asyncThing()).anotherSyncMethod()
. I find that using synchronous methods for these operations a bit simpler and easier to read unless we need to do multiple things simultaneously.
fs-extra doesn't create so much overhead as it uses fs internally, it just extends it
For this, I think it's more of a reason to not have it as a dependency, especially when we can already do the things we need with node's fs module.
Another reason is also to reduce and minimize dependencies as much as possible, recent survey shows that managing dependencies is one of the biggest pain points when working with JS. Generally speaking, I think the less dependencies any project has, the better the experience would be, both for the maintainers and the users.
Please let me know if you prefer to keep the async methods, I'll address them and make the changes.
@jesec feel free to merge if it looks good to you
This pull-request is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this pull-request entirely you can add the no-stale label
What's left to do?
@robertsLando ES6 fs/promises
import won't work with Node v12 (https://stackoverflow.com/a/70042193).
@robertsLando ES6
fs/promises
import won't work with Node v12 (https://stackoverflow.com/a/70042193).
NodeJS 14.x has passed the end of its LTS support. I doubt that 12.x should still be considered.
#1886
This pull-request is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this pull-request entirely you can add the no-stale label
This pull-request is now closed due to inactivity, you can of course reopen or reference this pull-request if you see fit.