node.js remove file

前端 未结 17 1455
误落风尘
误落风尘 2020-12-07 06:54

How do I delete a file with node.js?

http://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback

I don\'t see a remove command?

17条回答
  •  太阳男子
    2020-12-07 07:34

    Use NPM module fs-extra, which gives you everything in fs, plus everything is Promisified. As a bonus, there's a fs.remove() method available.

提交回复
热议问题