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

Add recursive: true to readdir functions #71

Open
mhkeller opened this issue Oct 26, 2017 · 4 comments
Open

Add recursive: true to readdir functions #71

mhkeller opened this issue Oct 26, 2017 · 4 comments
Milestone

Comments

@mhkeller
Copy link
Owner

mhkeller commented Oct 26, 2017

If you wanted to recursively read all csvs in a directory, for example. This should be fairly easy to do since it just means having readdir call itself if the option exists.

@mhkeller
Copy link
Owner Author

mhkeller commented Sep 1, 2018

A way to do this without adding another fs.stats and fs.statsSync call is to add a '/' to dirs when they're initially read. This is a minor, but breaking change.

@mhkeller
Copy link
Owner Author

mhkeller commented Sep 1, 2018

i'm thinking by default it should return a flat array and then have an option to have it mirror your directory structure. which behavior were you expecting @1wheel?

@1wheel
Copy link

1wheel commented Sep 1, 2018

Flat array sounds right, this is what I'd use it for 90% of the time:

glob.sync(raceDir + "/**/*.json")
	.map(io.readFileSync)
	.forEach(d => {
		...
	})

@aubergene
Copy link
Contributor

I've never used it either

@mhkeller mhkeller added this to the 4.0 milestone Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants