-
Notifications
You must be signed in to change notification settings - Fork 106
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
Callback on every file found #16
Labels
Comments
It's not absolutely needed, it'd just make things a bit faster I think -> I need to parse every |
Hm-m, you can use Promises: const transform = (stat) => new Promise((resolve, reject) => {
fs.readFile((err, content) => err ? reject(err) : resolve(content));
});
fastGlob('dir/**/*.txt', { transform, onlyFiles: true }).then((files) => {
// Here files is array of promises to read content of each file
return Promise.all(files);
}).then((files) => {
console.log(files); // ['content from dir/a.txt', ...]
}); |
Closed as outdated issue. Feel free to reopen if you wanted. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It'd be nice to have the ability to run a callback on every file, something like this:
The text was updated successfully, but these errors were encountered: