Use Exposes two functions. Both return a list of complete file paths in the order indicated by the name. var fileTraversal = require("file-traversal"); fileTraversal.breadth_1st(root_path); fileTraversal.depth_1st(root_path);