From 0942b071603fbed97ded14cb2802861ace05f029 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sat, 10 Apr 2021 11:30:52 +0200 Subject: [PATCH] Add async example to readme --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 79e0a39..2784155 100644 --- a/README.md +++ b/README.md @@ -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