Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Include fs-extra methods #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Include fs-extra methods #50

wants to merge 3 commits into from

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Oct 21, 2020

Description of the change

This adds fs-extra methods. In the export section of the library, they are considered "after" fs-plus methods, so it will not have any conflict or breakage.

Future Improvements

The method that this PR adds fs-extra is minimal. Later, I will add support for named exports and tree-shaking.

Currently, there are a few methods that are used in both packages. Technically, we do not need to use mkdirp, rimraf, etc anymore since fs-extra supports all of these (with a more up to date implementation). Some other methods from the fs-plus are not using the native fs functions which means they do not support all types of inputs such as Buffer or URL. In future PRs, I will write a few type-dispatch sentences to decide between the native implementation and fs-plus implementation. This allows keeping the methods of fs-plus that offer anything interesting over the native fs functions.

copyFileSync
existsSync
writeFile
writeFileSync
copySync
copy
moveSync
move
remove
removeSync

So, this PR paves the way for future PRs. 🚀

Benefits

fs-extra has many good methods which we can use. We will not need to install two separate fs library anymore! Including fs-extra in the Atom snapshot means that anyone using fs-extra will benefit from the speed up! 🎉

Verification

All the tests pass.

Release Notes

  • Include fs-extra methods in fs-plus.

@jimmywarting
Copy link

node have built in support for mkdirp and rimraf now... neither you or fs.extra need to provide this methods

@aminya
Copy link
Contributor Author

aminya commented May 17, 2021

@jimmywarting This package is used inside Electron, which still uses Node 12. The functions you mentioned are either non-available or are not backward compatible with the users of this library (require manual updating).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants