diff --git a/doc/api/fs.md b/doc/api/fs.md index 510a44b9f2de2c..3fbdfc34726fe6 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2444,8 +2444,21 @@ changes: * `callback` {Function} * `err` {Error} -Asynchronous unlink(2). No arguments other than a possible exception are given -to the completion callback. +Asynchronously removes a file or symbolic link. No arguments other than a +possible exception are given to the completion callback. + +```js +// 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) ## fs.unlinkSync(path)