As of Node.js 14.14.0, the recommended way is to use fs.rmSync
:
fs.rmSync(dir, { recursive: true, force: true });
More Related Contents:
- Node.js – Find home directory in platform agnostic way
- How to fix npm throwing error without sudo
- In what scope are module variables stored in node.js?
- Node error: SyntaxError: Unexpected token import
- chai test array equality doesn’t work as expected
- What is an example of the simplest possible Socket.io example?
- Get all directories within directory nodejs
- When to use next() and return next() in Node.js
- Mongoose/mongoDB query joins.. but I come from a sql background
- Include the document id as a field id in firestore
- Get hostname of current request in node.js Express
- How can I increase the maximum call stack size in Node.js
- passport.js passport.initialize() middleware not in use
- Detect if called through require or directly by command line
- Package cairo was not found in the pkg-config search path. Node j.s install canvas issue
- Catch all uncaughtException for Node js app
- Why is ‘type: module’ in package.json file?
- MongoDB – get documents with max attribute per group in a collection
- How to resolve Node.js: “Error: ENOENT: no such file or directory”
- Nodemon Error: “System limit for number of file watchers reached”
- How to create full path with node’s fs.mkdirSync?
- Examples in using RedisStore in socket.io
- node.js remove file
- Can’t install any packages in Node.js using “npm install”
- Cloud Functions for Firebase – Converting PDF to image
- How can I output data before I end the response?
- How to send data from JQuery AJAX request to Node.js server
- Uploading multiple files with multer, but from different fields?
- socket.io private message
- Windows Azure Websites is overriding my 404 and 500 error pages in my node.js app