Is node.js rmdir recursive ? Will it work on non empty directories?

后端 未结 22 1360
清歌不尽
清歌不尽 2021-01-31 13:41

The documentation for fs.rmdir is very short and doesn\'t explain the behavior of rmdir when the directory is not empty.

Q: What happens if I try to use

22条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 13:52

    most of the examples I see out there are synchronous implementations of recursively deleting a folder structure in node.

    I've also seen a few asynchronous ones that dont actually work well.

    I wrote and use one thats completely asynchronous: https://gist.github.com/yoavniran/adbbe12ddf7978e070c0

提交回复
热议问题