fleet-docs/node_modules/fs-monkey
divya-mohan0209 9de94a264c Initial commit 2022-09-22 09:54:31 +05:30
..
docs/api Initial commit 2022-09-22 09:54:31 +05:30
lib Initial commit 2022-09-22 09:54:31 +05:30
CHANGELOG.md Initial commit 2022-09-22 09:54:31 +05:30
LICENSE Initial commit 2022-09-22 09:54:31 +05:30
README.md Initial commit 2022-09-22 09:54:31 +05:30
package.json Initial commit 2022-09-22 09:54:31 +05:30

README.md

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.