Skip to content

Commit

Permalink
doc: improve fs api descriptions
Browse files Browse the repository at this point in the history
This improves the api descriptions for fs.chown, fs.chmod, and fs.mkdir
along with their *Sync counterparts.

PR-URL: #17679
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
evanlucas authored and gibfahn committed Jan 24, 2018
1 parent 7f29a98 commit 5784522
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,10 @@ added: v0.1.30
* `callback` {Function}
* `err` {Error}

Asynchronous chmod(2). No arguments other than a possible exception are given
to the completion callback.
Asynchronously changes the permissions of a file. No arguments other than a
possible exception are given to the completion callback.

See also: chmod(2)

## fs.chmodSync(path, mode)
<!-- YAML
Expand All @@ -521,7 +523,10 @@ added: v0.6.7
* `path` {string|Buffer}
* `mode` {integer}

Synchronous chmod(2). Returns `undefined`.
Synchronously changes the permissions of a file. Returns `undefined`.
This is the synchronous version of [`fs.chmod()`][].

See also: chmod(2)

## fs.chown(path, uid, gid, callback)
<!-- YAML
Expand All @@ -534,8 +539,10 @@ added: v0.1.97
* `callback` {Function}
* `err` {Error}

Asynchronous chown(2). No arguments other than a possible exception are given
to the completion callback.
Asynchronously changes owner and group of a file. No arguments other than a
possible exception are given to the completion callback.

See also: chown(2)

## fs.chownSync(path, uid, gid)
<!-- YAML
Expand All @@ -546,7 +553,10 @@ added: v0.1.97
* `uid` {integer}
* `gid` {integer}

Synchronous chown(2). Returns `undefined`.
Synchronously changes owner and group of a file. Returns `undefined`.
This is the synchronous version of [`fs.chown()`][].

See also: chown(2)

## fs.close(fd, callback)
<!-- YAML
Expand Down Expand Up @@ -1118,8 +1128,10 @@ added: v0.1.8
* `callback` {Function}
* `err` {Error}

Asynchronous mkdir(2). No arguments other than a possible exception are given
to the completion callback. `mode` defaults to `0o777`.
Asynchronously creates a directory. No arguments other than a possible exception
are given to the completion callback. `mode` defaults to `0o777`.

See also: mkdir(2)

## fs.mkdirSync(path[, mode])
<!-- YAML
Expand All @@ -1129,7 +1141,10 @@ added: v0.1.21
* `path` {string|Buffer}
* `mode` {integer}

Synchronous mkdir(2). Returns `undefined`.
Synchronously creates a directory. Returns `undefined`.
This is the synchronous version of [`fs.mkdir()`][].

See also: mkdir(2)

## fs.mkdtemp(prefix[, options], callback)
<!-- YAML
Expand Down Expand Up @@ -2316,11 +2331,14 @@ The following constants are meant for use with the [`fs.Stats`][] object's
[Caveats]: #fs_caveats
[`fs.access()`]: #fs_fs_access_path_mode_callback
[`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback
[`fs.chmod()`]: #fs_fs_chmod_path_mode_callback
[`fs.chown()`]: #fs_fs_chown_path_uid_gid_callback
[`fs.exists()`]: fs.html#fs_fs_exists_path_callback
[`fs.fstat()`]: #fs_fs_fstat_fd_callback
[`fs.FSWatcher`]: #fs_class_fs_fswatcher
[`fs.futimes()`]: #fs_fs_futimes_fd_atime_mtime_callback
[`fs.lstat()`]: #fs_fs_lstat_path_callback
[`fs.mkdir()`]: #fs_fs_mkdir_path_mode_callback
[`fs.mkdtemp()`]: #fs_fs_mkdtemp_prefix_options_callback
[`fs.open()`]: #fs_fs_open_path_flags_mode_callback
[`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback
Expand Down

0 comments on commit 5784522

Please sign in to comment.