File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -2444,8 +2444,21 @@ changes:
24442444* ` callback ` {Function}
24452445 * ` err ` {Error}
24462446
2447- Asynchronous unlink(2). No arguments other than a possible exception are given
2448- to the completion callback.
2447+ Asynchronously removes a file or symbolic link. No arguments other than a
2448+ possible exception are given to the completion callback.
2449+
2450+ ``` js
2451+ // Assuming that 'path/file.txt' is a regular file.
2452+ fs .unlink (' path/file.txt' , (err ) => {
2453+ if (err) throw err;
2454+ console .log (' path/file.txt was deleted' );
2455+ });
2456+ ```
2457+
2458+ ` fs.unlink() ` will not work on a directory, empty or otherwise. To remove a
2459+ directory, use [ ` fs.rmdir() ` ] [ ] .
2460+
2461+ See also: unlink(2)
24492462
24502463## fs.unlinkSync(path)
24512464<!-- YAML
@@ -3173,6 +3186,7 @@ The following constants are meant for use with the [`fs.Stats`][] object's
31733186[ `fs.read()` ] : #fs_fs_read_fd_buffer_offset_length_position_callback
31743187[ `fs.readFile()` ] : #fs_fs_readfile_path_options_callback
31753188[ `fs.readFileSync()` ] : #fs_fs_readfilesync_path_options
3189+ [ `fs.rmdir()` ] : #fs_fs_rmdir_path_callback
31763190[ `fs.stat()` ] : #fs_fs_stat_path_callback
31773191[ `fs.utimes()` ] : #fs_fs_utimes_path_atime_mtime_callback
31783192[ `fs.watch()` ] : #fs_fs_watch_filename_options_listener
You can’t perform that action at this time.
0 commit comments