A function that iterates recursively through a directory structure and returns it as a normal array. Supports glob syntax to ignore files if needed.
npm install file-tree-syncA function that iterates recursively through a directory structure and returns it as a normal array. Supports glob syntax to ignore files if needed.
Installation:
``sh`
$ npm install file-tree-sync
Use in your code:
`
var treeify = require('file-tree-sync');
var myTree = treeify(process.cwd(), ['.*']);
`
It returns an array that looks like this:
`json``
[
{
"name": "
"fullpath": "
"relativePath": "
"files": [....] // array of the same type of object
},
...
]