arraydir
v2.0.0
Published
> 递归遍历目录
Downloads
2
Readme
arraydir模块
递归遍历目录
import * as arraydir from 'arraydir';
const currentPath = path.resolve(__dirname) + arraydir.PS;
const fileList = arraydir
.load(interfacePath)
.filter(file => /\.(js)$/i.test(file));
console.log(fileList);
[
'app.js',
'index.js',
'test.js',
'lib/test.js'
]
module 'arraydir' {
/**
* 目录分隔符,Linux/Mac下为 / ;Win下为 \
*/
export var PS: string;
export function load(path: string) : string[]
}