Node.js: How to check if folder is empty or not with out uploading list of files

后端 未结 6 2076
日久生厌
日久生厌 2021-02-12 18:59

I am using Node.js.

I want to check if folder is empty or not? One option is to use fs.readdir but it loads whole bunch of

6条回答
  •  说谎
    说谎 (楼主)
    2021-02-12 19:47

    What about globbing? ie, exists myDir/*. It is not supported out of box by node (TOW v0.10.15), but bunch of modules will do that for you, like minimatch

提交回复
热议问题