How will you truncate a file using node?
Answer / Swati
To truncate (clear) a file in Node.js, you can use the `fs.truncate()` method:n```javascriptnfs.truncate('file_path', 0, function(err){...});```
| Is This Answer Correct ? | 0 Yes | 0 No |
How to create a self-signed certificate in Node.js?
What do you mean by “streams”? What are the different types of streams in node.js?
Explain npm in node.js?
what is the use of underscore in nodejs?
How will you debug an application in Node.js?
Who invented node?
What is Tracing in Node.js?
List out some repl commands in node.js?
Why to use express.js?
Difference between setImmediate() vs setTimeout()?
Is nodejs secure?
How is node js used in web development?