# not-memory-fs

> A descendant of MemoryFileSystem that persists to disk instead of memory

Latest version **0.1.0** (published 2018-03-06) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install not-memory-fs
pnpm add not-memory-fs
yarn add not-memory-fs
bun add not-memory-fs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-03-06 |
| First published | 2018-03-06 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Olegs Jeremejevs |
| Maintainers | jeremejevs |
| Keywords | memory-fs |

## Links

- npm: https://www.npmjs.com/package/not-memory-fs
- Repository: https://github.com/jeremejevs/not-memory-fs
- Issues: https://github.com/jeremejevs/not-memory-fs/issues
- npm.io page: https://npm.io/package/not-memory-fs

## Dependencies (1)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1

## Recent versions

- 0.1.0 (latest) — 2018-03-06

## README

### not-memory-fs

A descendant of [MemoryFileSystem](https://github.com/webpack/memory-fs) that
persists to disk instead of memory, created to address [this
issue](https://github.com/webpack/webpack-dev-middleware/issues/239).

This business is somewhat risky, because it's possible for some module which
expects this to be a vanilla MemoryFileSystem to wreak havoc on the system,
doing an `rm -rf` on the root directory or some such. Hence the need for a
sandbox, to limit the possible damage (best-effort).

Why not persist to disk asynchronously, while forwarding requests to
MemoryFileSystem synchronously, that way preserving the original performance
boost? Because this keeps the code simple, and allows one to edit the files and
have those changes noticed by the consumer of the file system. And the boost is
becoming negligible on NVMe SSDs (though the writes do, unfortunately, damage
the drive unnecessarily).

`memory-fs` is just a development dependency. Why? It's important for this
module and the code running `instanceof MemoryFileSystem` to require the same
copy of `memory-fs`, otherwise it may resolve to `false`, negating the main
purpose of this wrapper, like in `webpack-dev-middleware`'s case.

`mkdirp` brings an unnecessary dependency with it, `minimist`, unfortunately,
but it's tiny, so that's tolerable.

---
_Source: https://npm.io/package/not-memory-fs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
