desirae.js/lib/walk.js

29 lines
597 B
JavaScript
Raw Normal View History

2015-01-05 19:23:26 +00:00
'use strict';
var PromiseA = require('bluebird').Promise
, path = require('path')
, walk = require('walk')
, walker
;
function getFs(parent, sub) {
// TODO safe
var trueRoot = path.resolve(parent, sub)
;
return new PromiseA(function (resolve) {
walker = walk.walk('posts');
walker.on('directories', function (root, stat, next) {
console.log(root, stat);
next();
});
walker.on('files', function (root, stat, next) {
//console.log(root, stat);
next();
});
walker.on('end', function () {
console.log('done');
});
});
}