securityos/node_modules/fs-monkey
Berkeley 927854894b First commit 2024-09-06 12:32:35 -03:00
..
docs/api First commit 2024-09-06 12:32:35 -03:00
lib First commit 2024-09-06 12:32:35 -03:00
src First commit 2024-09-06 12:32:35 -03:00
.babelrc First commit 2024-09-06 12:32:35 -03:00
.nvmrc First commit 2024-09-06 12:32:35 -03:00
.travis.yml First commit 2024-09-06 12:32:35 -03:00
LICENSE First commit 2024-09-06 12:32:35 -03:00
README.md First commit 2024-09-06 12:32:35 -03:00
index.js First commit 2024-09-06 12:32:35 -03:00
package.json First commit 2024-09-06 12:32:35 -03:00
renovate.json First commit 2024-09-06 12:32:35 -03:00
yarn.lock First commit 2024-09-06 12:32:35 -03:00

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 the give fs-like object vol for module loading

License

Unlicense - public domain.