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: suggest alternatives to deprecated APIs #1007

Closed
wants to merge 1 commit into from
Closed

doc: suggest alternatives to deprecated APIs #1007

wants to merge 1 commit into from

Conversation

benjamingr
Copy link
Member

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

@othiym23
Copy link
Contributor

I suggested a minor wording tweak, but LGTM otherwise.

@mscdex mscdex changed the title doc: suggest alternatives to deprecated APs doc: suggest alternatives to deprecated APIs Feb 28, 2015

`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).
Copy link
Contributor

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.

@benjamingr
Copy link
Member Author

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).
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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
@benjamingr
Copy link
Member Author

@tellnes addressed comment and squashed.

tellnes pushed a commit that referenced this pull request Mar 1, 2015
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>
@tellnes
Copy link
Contributor

tellnes commented Mar 1, 2015

Landed as c380ac6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants