Is there a npm package that can empty the folder?

I don"t know if npm can have commands to empty folders, so that I can write to npm script

.

rimraf is specifically used to delete folders, but I don"t want to delete folders, but empty them. I don"t know if there is a npm that can use

.

if you have nodejs directly, please post the code

Mar.03,2021

if you just want to use the npm package, you can try fs-extra , it is based on the fs module to do a lot of packaging is expanded, the basic operation of the file can be satisfied, you mean to understand.

address: https://www.npmjs.com/package.
the method of emptying the folder you want. Refer to this: https://github.com/jprichards.

. < hr >

in fact, instead of npm package, you can solve it with a single Linux command.

$ rm -rf ./dirname
$ mkdir dirname

npm install empty-folder

rimraf

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b373a7-2c083.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b373a7-2c083.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?