Skip to content

🛠 Repo: Replace fs-extra with newer fs built-ins #5266

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Tooling Suggestion Checklist

Overview

I ran eslint-plugin-depend on the Mocha repo. It had two reports about fs-extra:

/Users/josh/repos/mocha/test/integration/helpers.js
  5:12  error  "fs-extra" should be replaced with an alternative package. Read more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/fs-extra.md  depend/ban-dependencies

/Users/josh/repos/mocha/test/integration/options/watch.spec.js
  3:12  error  "fs-extra" should be replaced with an alternative package. Read more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/fs-extra.md  depend/ban-dependencies

Per https://github.com/es-tooling/module-replacements/blob/main/docs/modules/fs-extra.md:

fs-extra adds some file system methods that previously were not included in the native fs module and added Promise support to the fs methods.
Many of the fs-extra modules have since been implemented natively by Node.

Proposal: let's switch to native node:fs / node:fs/promises.

Additional Info

Note that both are within test/integration. This shouldn't impact users.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions