recursive-dir-reader
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "recursive-dir-reader", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "reading directory and subdirectories", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,3 @@ ##### The module is required for sync or async reading of dir and subdirs. | ||
##Usage | ||
## Usage | ||
For example, we have the following directory structure: | ||
@@ -65,3 +65,24 @@ | ||
// ] | ||
``` | ||
You can easily combine this methods. | ||
```javascript | ||
const filesIntoDirAsync = readdir.async('./someDir', path => { | ||
console.info(path); | ||
}); | ||
// ./someDir/someFile1.js | ||
// ./someDir/someFile2.js | ||
// ./someDir/someSubDir/someModule1.js | ||
// ./someDir/someSubDir/someModule2.js | ||
// ./someDir/someSubDir/folderWithOneFile/template.html | ||
setTimeout(() => { | ||
console.info(filesIntoDirAsync); | ||
}, 1000); | ||
// [ | ||
// './someDir/someFile1.js', | ||
// './someDir/someFile2.js', | ||
// './someDir/someSubDir/someModule1.js', | ||
// './someDir/someSubDir/someModule2.js', | ||
// './someDir/someSubDir/folderWithOneFile/template.html' | ||
// ] | ||
``` |
Sorry, the diff of this file is not supported yet
18879
86