How we can delete a file in node js?



How we can delete a file in node js?..

Answer / Dharmendra Kumar Mourya

You can delete a file in Node.js using the `fs` module's `unlinkSync()` function. Example: `const fs = require('fs'); fs.unlinkSync('<path_to_file>')`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Node.js Interview Questions

What is a callback in node.js?

1 Answers  


What is error-first callback?

1 Answers  


Is node js a backend language?

1 Answers  


What language is node js written in?

1 Answers  


What ides you can use for node.js development?

1 Answers  


Using the event loop what are the tasks that should be done asynchronously?

1 Answers  


Why do we need promises in node js?

1 Answers  


What are the exit codes in node.js? Can you list a few exit codes?

1 Answers  


How to get started with node.js?

1 Answers  


Explain node.js web application architecture?

1 Answers  


What is the use of net.Socket in Node.js?

1 Answers  


What is the passport in Node.js?

1 Answers  


Categories