Skip to content

Instantly share code, notes, and snippets.

View nanhupatar's full-sized avatar
🎯
Focusing

叫我小胡同学 nanhupatar

🎯
Focusing
  • FEGuide
  • 广州
View GitHub Profile
@dongyuwei
dongyuwei / dir2tree.js
Created March 30, 2012 07:31
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,
};