find-files-array

npm i -S find-files

Usage no npm install needed!

<script type="module">
  import findFilesArray from 'https://cdn.skypack.dev/find-files-array';
</script>

README

npm i -S find-files

使用

const ff = require("find-files-array")

let res = ff(
    {
        paths: [
            "C:\\Users\\EDZ\\Desktop\\aaa",  // 待查找的目录1
            "C:\\Users\\EDZ\\Desktop\\pk" // 待查找的目录2
        ],
        type: [".md", ".json"], // 需要的文件类型
        structure: true // 保持文件目录结构输出 默认false
    }
)

console.log(res)

option

  • paths:[Array],待查找的目录数组
  • type:[Array],匹配的文件类型
  • structure:[Boolean],返回值是否保持文件结构 ,默认false,输出一维数组