-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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: suggest alternatives to deprecated APIs #1007
Conversation
I suggested a minor wording tweak, but LGTM otherwise. |
|
||
`fs.existsSync()` is **deprecated**. | ||
`fs.existsSync()` is **deprecated**. For future proof alternatives please check out [`fs.statSync`](fs.html#fs_fs_statsync_path) or [`fs.access`](fs.html#fs_fs_accesssync_path_mode). |
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.
It should be fs.accessSync
instead of fs.access
. The link URL is correct though.
Thanks, addressed comments and squashed. |
@@ -642,6 +642,9 @@ callback, and have some fallback logic if it is null. | |||
|
|||
## fs.exists(path, callback) | |||
|
|||
`fs.exists()` is **deprecated**. For supported alternatives please check out | |||
[`fs.stat`](fs.html#fs_fs_stat_path_callback) or [`fs.access`](fs.html#fs_fs_access_path_mode_callback). |
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.
Please wrap lines at 80 chars.
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.
@tellnes I wanted to wrap the line at 80 columns but am unsure how do wrap lines at 80 chars in the source but keep them at 80 characters in the markdown.
Is there a way to wrap the line here while not doing so in the output?
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.
Isn't single newlines parsed as space in markdown?
Edit: Just wrap after or
.
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.
Let me
try
Edit: no, I'll see if I can find a better solution and if I can't by tomorrow I'll wrap after or
At the moment users who want to use `fs.exists` get a warning that the method is deprecated but do not get offered an alternative in the page. This PR suggests `fs.stat` and `fs.access` as alternatives while keeping the warning about the use case in place. This PR closes #1002
@tellnes addressed comment and squashed. |
At the moment users who want to use `fs.exists` get a warning that the method is deprecated but do not get offered an alternative in the page. This PR suggests `fs.stat` and `fs.access` as alternatives while keeping the warning about the use case in place. Fixes: #1002 PR-URL: #1007 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Christian Tellnes <christian@tellnes.no>
Landed as c380ac6 |
At the moment users who want to use
fs.exists
get a warning that the method is deprecated but do not get offered an alternative in the page. This PR suggestsfs.stat
andfs.access
as alternatives while keeping the warning about the use case in place.This PR closes #1002