node-directory-tree
node-directory-tree copied to clipboard
Added depth option
Minimal code change, optional depth option, new test and updated README.md 🙂
Fix #34
Hi, thanks for the PR!
I suggest you extract the code in a new directoryTreeWithDepth function that takes an extra depth parameter which is still Number? and decrement that as a primitive value. This I think makes things easier to follow (the depth recursion pattern is pretty familiar to people I think) and you also get around the issue of copying the settings object every time.