Skip to content

Commit a6ec0bf

Browse files
authored
docs: dir was renamed to path a while back (#1060)
1 parent 1c9db5d commit a6ec0bf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/snapshot/index.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ import * as snapshot from 'memfs/lib/snapshot';
3030
You can convert any folder of an `fs`-like file system into a POJO snapshot.
3131

3232
```ts
33-
const snap = snapshot.toSnapshotSync({ fs, dir });
34-
const snap = await snapshot.toSnapshot({ fs: fs.promises, dir });
33+
const snap = snapshot.toSnapshotSync({ fs, path });
34+
const snap = await snapshot.toSnapshot({ fs: fs.promises, path });
3535
```
3636

3737
Then import it back from snapshot.
3838

3939
```ts
40-
snapshot.fromSnapshotSync(snap, { fs, dir });
41-
await snapshot.fromSnapshot(snap, { fs: fs.promises, dir });
40+
snapshot.fromSnapshotSync(snap, { fs, path });
41+
await snapshot.fromSnapshot(snap, { fs: fs.promises, path });
4242
```
4343

4444
## Binary snapshot
@@ -47,15 +47,15 @@ Binary snapshots are encoded as CBOR `Uint8Array` buffers. You can convert any
4747
folder of an `fs`-like file system into a `Uint8Array` snapshot.
4848

4949
```ts
50-
const uint8 = snapshot.toBinarySnapshotSync({ fs, dir });
51-
const uint8 = await snapshot.toBinarySnapshot({ fs: fs.promises, dir });
50+
const uint8 = snapshot.toBinarySnapshotSync({ fs, path });
51+
const uint8 = await snapshot.toBinarySnapshot({ fs: fs.promises, path });
5252
```
5353

5454
Then import it back from `Uint8Array` snapshot.
5555

5656
```ts
57-
snapshot.fromBinarySnapshotSync(uint8, { fs, dir });
58-
await snapshot.fromBinarySnapshot(uint8, { fs: fs.promises, dir });
57+
snapshot.fromBinarySnapshotSync(uint8, { fs, path });
58+
await snapshot.fromBinarySnapshot(uint8, { fs: fs.promises, path });
5959
```
6060

6161
## JSON snapshot
@@ -67,15 +67,15 @@ data is encoded as Base64 data URL strings. The resulting JSON is returned as
6767
You can convert any folder of an `fs`-like file system into a `Uint8Array` snapshot.
6868

6969
```ts
70-
const uint8 = snapshot.toJsonSnapshotSync({ fs, dir });
71-
const uint8 = await snapshot.toJsonSnapshot({ fs: fs.promises, dir });
70+
const uint8 = snapshot.toJsonSnapshotSync({ fs, path });
71+
const uint8 = await snapshot.toJsonSnapshot({ fs: fs.promises, path });
7272
```
7373

7474
Then import it back from `Uint8Array` snapshot.
7575

7676
```ts
77-
snapshot.fromJsonSnapshotSync(uint8, { fs, dir });
78-
await snapshot.fromJsonSnapshot(uint8, { fs: fs.promises, dir });
77+
snapshot.fromJsonSnapshotSync(uint8, { fs, path });
78+
await snapshot.fromJsonSnapshot(uint8, { fs: fs.promises, path });
7979
```
8080

8181
## Encoding format

0 commit comments

Comments
 (0)