fs.unlink(path, callback)
- path<string> | <Buffer> | <URL>
- callback<Function>- err<Error>
 
异步地删除文件或符号链接。 除了可能的异常之外,没有为完成回调提供任何参数。
// 假设 'path/file.txt' 是普通文件。
fs.unlink('path/file.txt', (err) => {
  if (err) throw err;
  console.log('path/file.txt was deleted');
});fs.unlink() 不适用于目录,无论是空目录还是其他目录。
要删除目录,请使用 fs.rmdir()。
另见: unlink(2)。
- path<string> | <Buffer> | <URL>
- callback<Function>- err<Error>
 
Asynchronously removes a file or symbolic link. No arguments other than a possible exception are given to the completion callback.
// Assuming that 'path/file.txt' is a regular file.
fs.unlink('path/file.txt', (err) => {
  if (err) throw err;
  console.log('path/file.txt was deleted');
});fs.unlink() will not work on a directory, empty or otherwise. To remove a
directory, use fs.rmdir().
See also: unlink(2).
