An easy way to walk your file system recursively.
An easy way to walk your file system recursively. This package is an fs.readdir recursive directory search, that returns an array analogous to a simple fs.readdir call.
npm install easy-file-walker
Easy File Walker makes use of promises.
Lets say we have the following directory structure:
The walker.walk function will return the following result from the above file structure:
var result ='inner-folder''inner-folder/my-inner-file.js''my-file.js';
This example uses the same folder structure as above under Usage.
var path = require'path';var walker = require'easy-file-walker';var myPath = pathjoin__dirname 'folder';walkerwalkmyPaththenconsole.logfiles;// logs:// [// 'inner-folder',// 'inner-folder/my-inner-file.js',// 'my-file.js'// ]console.error'An error has occured!';;