through.obj(function(dir, e, c) { var out = _parseOutput(output, dir.path); if (out.existing && fs.readFileSync(out.path, 'utf-8').indexOf(builder._MODULE_GENERATOR) !== 0) { return; } _buildDoc(dir.path, dir.path, dir.path, includes, excludes, function(modules) { var _file = new gutil.File({ base: dir.path, path: out.path, contents: new Buffer( builder._MODULE_GENERATOR + '\n' + ejs.render(tpl, { modules: modules, path: out.path.substr(dir.path.length).replace(/\\/g, '/').replace(/\/[^/]+$/, '') })) }); gutil.log('build module: ' + _file.path + '\n' + _file.contents) this.push(_file); c(); }.bind(this)); })