Nodejs: restore a deleted file with fs.unlink

Is possible to restore files that has been removed with fs.unlink() or fs.unlinkSync()?

No.

fs.unlink will use OS dependent functionality to remove file, and this is permanent, same as rm in linux.

There might be very complex options that are used by data recovery companies. But there is no such functionality in node natively.

unlink is a system call in linux, the name comes from there. It deletes the file/folder entry or link from filesystem. It does not wipe out the file.

So is it possible to restore such files ? Yes. It is possible, but

Can you guranatee restoration ? No. The space occupied by file is released back to the system. So it can be written over by other processes.

Should you expect restoration ? No. It was not supposed to provide recycle bin like functionality. It is a low level method for programs to access filesystem.

If you asked how to do it in Node, the answer is: not natively.
You would have to write some C/C++ module to do this, as dealing with the disk in this way is veeery low level.

If you asked how to do it with desktop applications, the answer is: google it, there are lots of tools for this purpose.