Deleting a file using unlink or unlinkSync

suggest change

Delete a file asynchronously:

var fs = require('fs');

fs.unlink('/path/to/file.txt', function(err) {
  if (err) throw err;

  console.log('file deleted');
});

You can also delete it synchronously*:

var fs = require('fs');

fs.unlinkSync('/path/to/file.txt');
console.log('file deleted');

* avoid synchronous methods because they block the entire process until the execution finishes.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Filesystem I/O:
* Deleting a file using unlink or unlinkSync

Table Of Contents
1 npm
3 Filesystem I/O
41 cli
43 grunt
59 Hack
64 ES6
67 Redis
69 MongoDB
86 MongoDB
87 Lodash
91 CORS
105 N-API
108 Require