Skip to content

Commit

Permalink
Use new in README examples
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Feb 6, 2022
1 parent 497c17f commit 379503e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Usage of a typical implementation looks as follows.

```js
// Create a database
const db = level('./db', { valueEncoding: 'json' })
const db = new Level('./db', { valueEncoding: 'json' })

// Add an entry with key 'a' and value 1
await db.put('a', 1)
Expand Down Expand Up @@ -166,8 +166,8 @@ Usage from TypeScript requires generic type parameters.

```ts
// Specify types of keys and values (any, in the case of json).
// The generic type parameters default to level<string, string>.
const db = level<string, any>('./db', { valueEncoding: 'json' })
// The generic type parameters default to Level<string, string>.
const db = new Level<string, any>('./db', { valueEncoding: 'json' })

// All relevant methods then use those types
await db.put('a', { x: 123 })
Expand Down

0 comments on commit 379503e

Please sign in to comment.