Skip to content

Commit

Permalink
docs: ✏️ describe memfs() helper in docs
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
streamich committed Apr 27, 2024
1 parent 0509f15 commit 0dfd7bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/node/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ vol.writeFileSync('/foo', 'bar');
expect(vol.toJSON()).toEqual({ '/foo': 'bar' });
```

Construct new `memfs` volumes:

```js
import { memfs } from 'memfs';

const { fs, vol } = memfs({ '/foo': 'bar' });

fs.readFileSync('/foo', 'utf8'); // bar
```

Create as many filesystem volumes as you need:

```js
Expand Down

0 comments on commit 0dfd7bb

Please sign in to comment.