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

Use graceful-fs #299

Closed
blond opened this issue Oct 8, 2016 · 1 comment
Closed

Use graceful-fs #299

blond opened this issue Oct 8, 2016 · 1 comment

Comments

@blond
Copy link

blond commented Oct 8, 2016

Hi!

I know that graceful-fs was removed because of monkeypatching (#71).

But since v4 graceful-fs this has been fixed:

Do not monkey-patch the fs module. This module may now be used as a drop-in dep, and users can opt into monkey-patching the fs builtin if their app requires it.

Why do I need graceful-fs?

I'm developing the tartifacts package. It uses glob-stream to find files by patters.

if run tartifacts for project with a large number of files, then glob fails (yandex/tartifacts#58):

Error: ENFILE: file table overflow, open

To fix this I have to do strange things using proxyquire:

const globStream = proxyquire('glob-stream', {
    'glob': proxyquire('glob', {
        'fs': require('graceful-fs')
    })
});

Why not call gracefulFs.gracefulify() in project?

In most cases, we can do that:

const realFs = require('fs');

const gracefulFs = require('graceful-fs');
const tartifacts = require('tartifacts');

gracefulFs.gracefulify(realFs);

tartifacts();

But tartifacts run glob-stream in different processes (yandex/tartifacts#40).

Alternatives

if there is another reason for which glob can't use graceful-fs need to be able change fs with options (#280).

@isaacs
Copy link
Owner

isaacs commented Mar 1, 2023

Definitely not going to go back to pulling in graceful-fs. Same answer as #280, add it to PathScurry, and glob will get it for free.

@isaacs isaacs closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants