Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

fs-monkey

streamich42.4mUnlicense1.0.6

Monkey patches for file system related things.

fs, file, file system, monkey, fsmonkey, monkeyfs, monkeypatch, patch

readme

fs-monkey

Monkey-patches for filesystem related things.

  • Rewrite require function to load Node's modules from memory.
  • Or rewrite the whole fs filesystem module.

Install

npm install --save fs-monkey

Terms

An fs-like object is an object that implements methods of Node's filesystem API. It is denoted as vol:

let vol = {
    readFile: () => { /* ... */ },
    readFileSync: () => { /* ... */ },
    // etc...
}

Reference

  • patchFs - rewrites Node's filesystem module fs with fs-like object vol
  • patchRequire - rewrites require function, patches Node's module module to use a given fs-like object for module loading

License

Unlicense - public domain.

changelog

1.0.6 (2024-05-01)

Bug Fixes

1.0.5 (2023-09-25)

Bug Fixes

  • look for exports.require in package.json in addition to main when patching require (#378) (411b791)

1.0.4 (2023-06-01)

Bug Fixes

1.0.3 (2021-04-05)

Bug Fixes

  • add missing parameter in jsdoc for patchRequire (#233) (28a5d9b)

1.0.1 (2020-05-14)

Bug Fixes

1.0.0 (2020-02-17)

Bug Fixes

  • export unixify from top level (d274d74)
  • export util from top level (16655c5)

Continuous Integration

  • 🎡 update semantic-release setup (5553829)

BREAKING CHANGES

  • 🧨 Release new major