Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "fs-monkey", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Monkey patches for file system related things.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# `fs-monkey` | ||
Monkey-patches for filesystem related things. | ||
[![][npm-img]][npm-url] | ||
Monkey-patches for filesystem related things. Rewrite `require` function, | ||
load Node's modules from memory. Or rewrite the whole `fs` filesystem module. | ||
**Terms** | ||
@@ -22,6 +23,6 @@ | ||
**API** | ||
`fs-monkey` **API** | ||
- [`patchFs(vol[, fs])`](#patchfsvol-fs) - rewrites Node's filesystem module `fs` with *fs-like* object `vol` | ||
- [`patchRequire(vol[, Module])`](#patchrequirevol-module) - patches Node's `module` module to use a give *fs-like* object `vol` for module loading | ||
- [`patchRequire(vol[, Module])`](#patchrequirevol-module) - rewrites `require` function, patches Node's `module` module to use a give *fs-like* object `vol` for module loading | ||
@@ -74,7 +75,7 @@ | ||
```js | ||
patchRequire({ | ||
let vol = { | ||
readFileSync: () => {}, | ||
realpathSync: () => {}, | ||
statSync: () => {}, | ||
}); | ||
}; | ||
``` | ||
@@ -81,0 +82,0 @@ |
32248
145