doc: improve fs code example quality#46948
Closed
jakecastelli wants to merge 3 commits intonodejs:mainfrom
Closed
Conversation
347d2b3 to
7ba5500
Compare
lpinca
approved these changes
Mar 4, 2023
doc/api/fs.md
Outdated
Comment on lines
7567
to
7568
| const fromDir = '/tmp/hello'; | ||
| const toDir = '/tmp/world'; |
Member
There was a problem hiding this comment.
Does this imply that /tmp/hello and /tmp/world are directories? I think, something like
Suggested change
| const fromDir = '/tmp/hello'; | |
| const toDir = '/tmp/world'; | |
| const fromPath = '/tmp/hello'; | |
| const toPath = '/tmp/world'; |
or
Suggested change
| const fromDir = '/tmp/hello'; | |
| const toDir = '/tmp/world'; | |
| const oldPath = '/tmp/hello'; | |
| const newPath = '/tmp/world'; |
would be less confusing.
a46a1f6 to
67da4a3
Compare
LiviaMedeiros
approved these changes
Mar 5, 2023
VoltrexKeyva
approved these changes
Mar 6, 2023
Ayase-252
approved these changes
Mar 6, 2023
aduh95
reviewed
Mar 6, 2023
| operation might complete before the `fs.rename()` operation: | ||
|
|
||
| ```js | ||
| const fs = require('node:fs'); |
Contributor
There was a problem hiding this comment.
We would typically need to have two examples here, one ESM and one CJS. (doesn't have to block this PR from landing, but it'd need to happen at some point)
Member
Author
There was a problem hiding this comment.
No problems, once this PR lands I can work on another PR to make sure all of the fs code examples have js flavor 👌 (at the moment there are many of the examples in fs missing them)
Collaborator
Commit Queue failed- Loading data for nodejs/node/pull/46948
FetchError: Invalid response body while trying to fetch https://api.github.com/graphql: Premature close
at consumeBody (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/node_modules/node-fetch/src/body.js:234:60)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Response.text (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/node_modules/node-fetch/src/body.js:158:18)
at async Request.json (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/lib/request.js:51:18)
at async Request.query (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/lib/request.js:109:20)
at async Request.queryAll (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/lib/request.js:136:20)
at async Request.gql (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/lib/request.js:66:22)
at async PRData.getComments (file:///opt/hostedtoolcache/node/18.14.2/x64/lib/node_modules/node-core-utils/lib/pr_data.js:97:21)
at async Promise.all (index 2)
at async Promise.all (index 1) {
type: 'system',
errno: 'ERR_STREAM_PREMATURE_CLOSE',
code: 'ERR_STREAM_PREMATURE_CLOSE',
erroredSysCall: undefined
}https://github.com/nodejs/node/actions/runs/4343149312 |
LiviaMedeiros
pushed a commit
that referenced
this pull request
Mar 6, 2023
PR-URL: #46948 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Qingyu Deng <[email protected]>
Member
|
Landed in 070e773 |
targos
pushed a commit
that referenced
this pull request
Mar 13, 2023
PR-URL: #46948 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Qingyu Deng <[email protected]>
targos
pushed a commit
that referenced
this pull request
Mar 14, 2023
PR-URL: #46948 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Qingyu Deng <[email protected]>
danielleadams
pushed a commit
that referenced
this pull request
Apr 11, 2023
PR-URL: #46948 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Qingyu Deng <[email protected]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
highlight.jsreserved keywordsfrom.