Skip to content

Put a warning against misusing *Sync methods to the API docs. #1684

@ChALkeR

Description

@ChALkeR

Taking apart #1665.

While #1674 looks like a good thing, almost eveyone seems to think that it replaces #1665. But it doesn't touch the initial point of #1665 — to discourage using *Sync versions of the methods that could be async.

The reasoning is mostly the same as in #1665.

Two alternatives here:

  1. Create a separate page with a warning against improper usage of blocking methods and add a small but instantly visible reference from every *Sync method documentation to that page.
    Sample:

    fs.accessSync(path[, mode])

    Warning: this is blocking call, do not use in an asynchronous enviroment unless you know what you are doing. More info on some nice title (link).

    Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise.

  2. Create a separate page with a warning and move all *Sync methods documentation to that page, leaving only references (possibly with headers) to it on the corresponding module pages.
    Sample:

    fs.accessSync(path[, mode])

    A blocking call, the documentation is listed on some nice title (link).

Notice: I am not a native English speaker and can be a bit wrong with woridings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions