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

Merge extfs with this repo #213

Closed
ghost opened this issue Jan 20, 2016 · 5 comments
Closed

Merge extfs with this repo #213

ghost opened this issue Jan 20, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 20, 2016

Hi,

Great work on this module, it really makes file/folder manipulation a lot easier.
I found myself having to check the existence of folders quite a lot, and I found the extfs module (https://github.com/marian2js/npm-extfs) perfect for this, but this module and extfs are kind of serving the same purposes, they even have common methods.
So I was wondering if you guys would like to merge (or to accept a PR that merges) extfs with fs-extra, especially as extfs looks like it's no longer maintained (it might not need to though).
Thank you,
Alvin

@ghost ghost changed the title Merge this repo with extfs Merge extfs with this repo Jan 20, 2016
@jprichardson
Copy link
Owner

It looks like npm-extfs could be rewritten to depend upon fs-extra. I'm not interested in the methods in in npm-extfs though (isEmpty / getDirs()). My priority is to get fs-extra to 1.0.0.

I appreciate your interest though.

@kruncher
Copy link

kruncher commented May 6, 2017

I personally would like to see isEmpty and isEmptySync make it into fs-extra.

@RyanZim
Copy link
Collaborator

RyanZim commented May 6, 2017

@kruncher With fs-extra v3, you can just do:

fs.readdir('dir').then(arr => Promise.all(arr.map(path => fs.pathExists(path)))

@kruncher
Copy link

kruncher commented May 6, 2017

@RyanZim "just" hehe, that seems quite verbose and prone to error.

I'd rather just do this:

if (fs.isEmptySync(path)) {
    console.log("The specified directory is empty!");
}

or:

fs.isEmpty(path).then(isEmpty => {
  if (isEmpty) {
    console.log("The specified directory is empty!");
  }
});

@RyanZim
Copy link
Collaborator

RyanZim commented May 6, 2017

You can open a new issue requesting this for reconsideration, can't promise anything. Locking to prevent further noise on this old thread.

Repository owner locked and limited conversation to collaborators May 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants