UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

21 lines (18 loc) 457 B
var fs = require('graceful-fs') var path = require('path') var walkSync = function (dir, filelist) { var files = fs.readdirSync(dir) filelist = filelist || [] files.forEach(function (file) { var nestedPath = path.join(dir, file) if (fs.lstatSync(nestedPath).isDirectory()) { filelist = walkSync(nestedPath, filelist) } else { filelist.push(nestedPath) } }) return filelist } module.exports = { walkSync: walkSync }