Recursive readdirSync, using `while` loop to prevent call stack from exceeding.
npm install recursive-sync-readdirwhile loop to prevent call stack from exceeding.

while loop instead of recursive function calls, and call stack is safe.shell
npm install recursive-sync-readdir
`Usage
`javascript
import read from 'recursive-sync-readdir';const files = read(
__dirname, // directory path
[ // exclude rules
/node_modules/, // match regular expression
'.git', // equals to string
path => path === 'dist', // filter function returns true
]
);
``