Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: reformat & improve node.1 manual page #5891

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions doc/api/fs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ fail, and does nothing otherwise.

## fs.appendFile(file, data[, options], callback)

* `file` {String|Number} filename or file descriptor
* `file` {String} filename
* `data` {String|Buffer}
* `options` {Object|String}
* `encoding` {String|Null} default = `'utf8'`
Expand All @@ -278,10 +278,6 @@ If `options` is a string, then it specifies the encoding. Example:
fs.appendFile('message.txt', 'data to append', 'utf8', callback);
```

Any specified file descriptor has to have been opened for appending.

_Note: Specified file descriptors will not be closed automatically._

## fs.appendFileSync(file, data[, options])

The synchronous version of [`fs.appendFile()`][]. Returns `undefined`.
Expand Down Expand Up @@ -620,7 +616,7 @@ Synchronous readdir(3). Returns an array of filenames excluding `'.'` and

## fs.readFile(file[, options], callback)

* `file` {String | Integer} filename or file descriptor
* `file` {String} filename
* `options` {Object | String}
* `encoding` {String | Null} default = `null`
* `flag` {String} default = `'r'`
Expand All @@ -646,10 +642,6 @@ If `options` is a string, then it specifies the encoding. Example:
fs.readFile('/etc/passwd', 'utf8', callback);
```

Any specified file descriptor has to support reading.

_Note: Specified file descriptors will not be closed automatically._

## fs.readFileSync(file[, options])

Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`.
Expand Down Expand Up @@ -945,7 +937,7 @@ the end of the file.

## fs.writeFile(file, data[, options], callback)

* `file` {String | Integer} filename or file descriptor
* `file` {String} filename
* `data` {String | Buffer}
* `options` {Object | String}
* `encoding` {String | Null} default = `'utf8'`
Expand Down Expand Up @@ -974,14 +966,10 @@ If `options` is a string, then it specifies the encoding. Example:
fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
```

Any specified file descriptor has to support writing.

Note that it is unsafe to use `fs.writeFile` multiple times on the same file
without waiting for the callback. For this scenario,
`fs.createWriteStream` is strongly recommended.

_Note: Specified file descriptors will not be closed automatically._

## fs.writeFileSync(file, data[, options])

The synchronous version of [`fs.writeFile()`][]. Returns `undefined`.
Expand Down
Loading