Pensieve
日常记录
日常记录
  • tool

    • yarn
    • powershell
    • 编辑器
    • git命令提示
    • vim
    • gitlab
    • husky-git钩子工具
  • wsl

    • 本机代理
  • html

    • 不常用功能
  • js

    • math 相关
    • js 日期相关
    • API参考
    • 算法相关
    • 图片相关
    • js 事件相关
    • 数据结构相关
    • vue
    • rxjs相关
  • node

    • 文件操作
    • svg压缩工具-svgo
  • go

    • go的一些命令
    • 文件操作
    • 网络相关
    • 目录结构推荐
    • 常用三方库
    • wasm
  • rust

    • Rust 入门笔记
    • wasm
    • 一些库
    • 圣经记录
  • linux

    • hyprland的一些问题
  • 杂项

    • 视频流相关

文件操作

递归文件夹

const func = filePath => {
    fs.readdir(filePath, (err, list) => {
        list.forEach(item => {
            const itemPath = path.resolve(filePath, item)
            fs.stat(itemPath, (err, data) => {
                if (data.isFile()) console.log(itemPath)
                else uploadFile(itemPath)
            })
        })
    })
}
Last Updated: 11/3/20, 5:00 PM
Contributors: dxy2233
Next
svg压缩工具-svgo