Package Exports
- iwalk
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iwalk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
iwalk 爱彳亍
遍历文件夹并得到所有文件路径
爱上您的磁盘目录
Installation
npm install iwalkUsage
var Walker = require("iwalk");
var walker = new Walker();
walker.walk(source, function (filename, isDirectory) {
console.log(filename);
console.log(isDirectory);
});
walker.on('end', function (total) {
console.log('遍历完啦, 一共%s个文件', total);
});Options
可以在获取文件的时候,跳过一些指定目录
var walker = new Walker({
// ignore dir
filterDir: ['.svn', 'node_modules', 'demo', '_source', 'com', 'test', 'doc', 'docs'],
// limit open dir count at the same time for avoid too many open files issue
limit: 10
});License
The MIT License