Skip to content

Instantly share code, notes, and snippets.

@liulixingyun
liulixingyun / dir2tree.js
Created August 6, 2016 02:22 — forked from dongyuwei/dir2tree.js
dir to tree by nodejs 递归遍历目录,生成一个js树对象.
(function() {
var path = require('path'), fs = require('fs');
function walk(uri,filter,tree) {
var node = {
name : null,
children : [],
pNode : null,
};