Skip to content

readdir docs don’t mention when options argument was added #12299

@chris-morgan

Description

@chris-morgan

fs.readdir(path[, options], callback)

History
Version Changes
v7.0.0 The callback parameter is no longer optional. Not passing it will emit a deprecation warning.
v0.1.8 Added in: v0.1.8

options was added in Node 6.0.0 by #5616. But it’s not mentioned, which led me to writing generic code that passed through undefined for options, which naturally made it fall apart on the Node 4 LTS release that doesn’t support options and so perceived it as just an undefined callback.

This really worries me. If something like this can change without any note in the history, what else is lacking history of changes that will come and bite me later? I no longer trust this documentation. At least https://nodejs.org/docs/latest-v4.x/api/fs.html#fs_fs_readdir_path_callback is still there, I’ll just need to remember to work there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions