Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Add async example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Apr 10, 2021
1 parent 83e3a3b commit 0942b07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ db.put('hey', 'you', (err) => {
})
```

With `async/await`:

```js
await db.put('hey', 'you')
const value = await db.get('hey', { asBuffer: false })
```

Your data is discarded when the process ends or you release a reference to the store. Note as well, though the internals of `memdown` operate synchronously - [`levelup`] does not.

## Browser support

[![Sauce Test Status](https://saucelabs.com/browser-matrix/level-ci.svg)](https://saucelabs.com/u/level-ci)
[![Sauce Test Status](https://app.saucelabs.com/browser-matrix/level-ci.svg)](https://app.saucelabs.com/u/level-ci)

## Data types

Expand Down

0 comments on commit 0942b07

Please sign in to comment.