Skip to content

maisui99/iwalk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iwalk 爱彳亍

遍历文件夹并得到所有文件路径

爱上您的磁盘目录

安装

npm install iwalk

使用

var Walker = require("iwalk");

var walker = new Walker();
walker.walk(source, function (filename, isDirectory) {
  console.log(filename);
  console.log(isDirectory);
});

walker.on('end', function () {
  console.log('遍历完啦');
});

#过滤目录

可以在获取文件的时候,跳过一些指定目录

var walker = new Walker({
    filterDir : ['.svn', 'node_modules', 'demo', '_source', 'com', 'test', 'doc', 'docs']
});

About

Walk dictionary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%