How do you delete a directory using node.js?



How do you delete a directory using node.js?..

Answer / Deepika

To delete a directory in Node.js, use the `rimraf` package (a faster alternative to `fs.rmdir`) or the built-in `fs` module's `rmdir` function: `const fs = require('fs'); fs.rmdir('<directory>', {recursive: true}, callback);`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Node.js Interview Questions

Does node.js support multithreading?

1 Answers  


Is node js a compiler?

1 Answers  


How can you uninstall a dependency using the npm?

1 Answers  


How to create function in node js?

1 Answers  


How do you close a file using node.js?

1 Answers  


How node.js is different from others server side frameworks like asp.net, php, jsp and ruby etc.?

1 Answers  


Is node js and javascript same?

1 Answers  


Is rails still relevant 2019?

1 Answers  


What is connect in node.js?

1 Answers  


What are Grunt and Gulp?

1 Answers  


What is the repl in context of node.js?

1 Answers  


What is test driven development (tdd)?

1 Answers  


Categories