- GitHub Staff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' # node file system module | |
path = require 'path' # node path module | |
# returns json tree representation of directory structure | |
tree = (root) -> | |
# clean trailing '/' | |
root = root.replace /\/+$/ , "" | |
# extract tree ring if root exists | |
if fs.existsSync root | |
ring = fs.lstatSync root |
NewerOlder