Skip to content

Commit

Permalink
docs: update snapshots page
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux authored Mar 1, 2023
1 parent 75b8f35 commit 4619326
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/content/3.utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ await assetsStorage.setItem("x", "hello!");

## Snapshots

## `snapshot(storage, base?)`
- `snapshot(storage, base?)`

Snapshot from all keys in specified base into a plain javascript object (string: string). Base is removed from keys.
Take a snapshot from all keys in specified base into a plain javascript object (string: string). Base is removed from keys.

```js
import { snapshot } from "unstorage";

const data = await snapshot(storage, "/etc");
```

## `restoreSnapshot(storage, data, base?)`
- `restoreSnapshot(storage, data, base?)`

Restore snapshot created by `snapshot()`.
Restore a snapshot created by `snapshot()`.

```js
await restoreSnapshot(storage, { "foo:bar": "baz" }, "/etc2");
Expand Down

0 comments on commit 4619326

Please sign in to comment.