Skip to content

Simple solution to read a very large directory in Node.js, based on bash find command

License

Notifications You must be signed in to change notification settings

Zlitus/large-directory-readdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

large-directory-readdir

Simple solution to read a very large directory in Node.js, based on bash find command. Developed because native fs.readdir methods can’t handle very large directories (Containing hundreds of thousands files).

Example of usage:

const ls = require('ls');

ls('./very-large-directory').then((output) => {
	var i = 0;
	output.on('line', (line) => {
		i++;
		console.log(i+') '+line);
	});
});

To do:

  • Security check of the parameter
  • Adding options (timeout, recursive, find only files / folders, match filenames by regex, etc)
  • Do fallbacks for Windows & systems without the find command

About

Simple solution to read a very large directory in Node.js, based on bash find command

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published