-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
Fix fs & util docs #18775
Closed
Closed
Fix fs & util docs #18775
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1210,6 +1210,7 @@ changes: | |
* `start` {integer} | ||
* `end` {integer} | ||
* `highWaterMark` {integer} | ||
* Returns: {ReadStream} | ||
|
||
Returns a new [`ReadStream`][] object. (See [Readable Streams][]). | ||
|
||
|
@@ -1285,6 +1286,7 @@ changes: | |
* `mode` {integer} | ||
* `autoClose` {boolean} | ||
* `start` {integer} | ||
* Returns: {WriteStream} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
|
||
Returns a new [`WriteStream`][] object. (See [Writable Stream][]). | ||
|
||
|
@@ -1442,6 +1444,7 @@ changes: | |
--> | ||
|
||
* `path` {string|Buffer|URL} | ||
* Returns: {boolean} | ||
|
||
Synchronous version of [`fs.exists()`][]. | ||
Returns `true` if the path exists, `false` otherwise. | ||
|
@@ -1560,6 +1563,7 @@ added: v0.1.95 | |
--> | ||
|
||
* `fd` {integer} | ||
* Returns: {fs.Stats} | ||
|
||
Synchronous fstat(2). Returns an instance of [`fs.Stats`][]. | ||
|
||
|
@@ -1834,6 +1838,7 @@ changes: | |
--> | ||
|
||
* `path` {string|Buffer|URL} | ||
* Returns: {fs.Stats} | ||
|
||
Synchronous lstat(2). Returns an instance of [`fs.Stats`][]. | ||
|
||
|
@@ -1959,6 +1964,7 @@ added: v5.10.0 | |
* `prefix` {string} | ||
* `options` {string|Object} | ||
* `encoding` {string} **Default:** `'utf8'` | ||
* Returns: {string} | ||
|
||
The synchronous version of [`fs.mkdtemp()`][]. Returns the created | ||
folder path. | ||
|
@@ -2083,6 +2089,7 @@ changes: | |
* `path` {string|Buffer|URL} | ||
* `flags` {string|number} | ||
* `mode` {integer} **Default:** `0o666` | ||
* Returns: {number} | ||
|
||
Synchronous version of [`fs.open()`][]. Returns an integer representing the file | ||
descriptor. | ||
|
@@ -2173,6 +2180,7 @@ changes: | |
* `path` {string|Buffer|URL} | ||
* `options` {string|Object} | ||
* `encoding` {string} **Default:** `'utf8'` | ||
* Returns: {Array} An array of filenames | ||
|
||
Synchronous readdir(3). Returns an array of filenames excluding `'.'` and | ||
`'..'`. | ||
|
@@ -2273,6 +2281,7 @@ changes: | |
* `options` {Object|string} | ||
* `encoding` {string|null} **Default:** `null` | ||
* `flag` {string} **Default:** `'r'` | ||
* Returns: {string|Buffer} | ||
|
||
Synchronous version of [`fs.readFile()`][]. Returns the contents of the `path`. | ||
|
||
|
@@ -2333,6 +2342,7 @@ changes: | |
* `path` {string|Buffer|URL} | ||
* `options` {string|Object} | ||
* `encoding` {string} **Default:** `'utf8'` | ||
* Returns: {string|Buffer} | ||
|
||
Synchronous readlink(2). Returns the symbolic link's string value. | ||
|
||
|
@@ -2355,6 +2365,7 @@ changes: | |
* `offset` {integer} | ||
* `length` {integer} | ||
* `position` {integer} | ||
* Returns: {number} | ||
|
||
Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. | ||
|
||
|
@@ -2465,6 +2476,7 @@ changes: | |
* `path` {string|Buffer|URL} | ||
* `options` {string|Object} | ||
* `encoding` {string} **Default:** `'utf8'` | ||
* Returns: {string|Buffer} | ||
|
||
Synchronously computes the canonical pathname by resolving `.`, `..` and | ||
symbolic links. | ||
|
@@ -2495,6 +2507,7 @@ added: v9.2.0 | |
* `path` {string|Buffer|URL} | ||
* `options` {string|Object} | ||
* `encoding` {string} **Default:** `'utf8'` | ||
* Returns: {string|Buffer} | ||
|
||
Synchronous realpath(3). | ||
|
||
|
@@ -2632,6 +2645,7 @@ changes: | |
--> | ||
|
||
* `path` {string|Buffer|URL} | ||
* Returns: {fs.Stats} | ||
|
||
Synchronous stat(2). Returns an instance of [`fs.Stats`][]. | ||
|
||
|
@@ -3197,6 +3211,7 @@ changes: | |
* `offset` {integer} | ||
* `length` {integer} | ||
* `position` {integer} | ||
* Returns: {number} | ||
|
||
## fs.writeSync(fd, string[, position[, encoding]]) | ||
<!-- YAML | ||
|
@@ -3211,6 +3226,7 @@ changes: | |
* `string` {string} | ||
* `position` {integer} | ||
* `encoding` {string} | ||
* Returns: {number} | ||
|
||
Synchronous versions of [`fs.write()`][]. Returns the number of bytes written. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
{stream.Readable}
See type-parser.js#L81-L84
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your kind pointing out!