Skip to content

Commit

Permalink
Docs: Fixed outdated examples (#589)
Browse files Browse the repository at this point in the history
* docs: fix `Low` calls in examples

* docs: add missing import

* docs: fix import path
  • Loading branch information
kon-pas authored Apr 30, 2024
1 parent 6fc49cc commit 1b004c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Adapters for reading and writing text. Useful for creating custom adapters.
Adapters for easily supporting other data formats or adding behaviors (encrypt, compress...).

```js
import { DataFile } from 'lowdb'
import { DataFile } from 'lowdb/node'
new DataFile(filename, {
parse: YAML.parse,
stringify: YAML.stringify
Expand Down Expand Up @@ -344,6 +344,7 @@ class SyncAdapter {
For example, let's say you have some async storage and want to create an adapter for it:

```js
import { Low } from 'lowdb'
import { api } from './AsyncStorage'

class CustomAsyncAdapter {
Expand All @@ -363,7 +364,7 @@ class CustomAsyncAdapter {
}

const adapter = new CustomAsyncAdapter()
const db = new Low(adapter)
const db = new Low(adapter, {})
```

See [`src/adapters/`](src/adapters) for more examples.
Expand Down Expand Up @@ -399,7 +400,7 @@ class YAMLFile {
}

const adapter = new YAMLFile('file.yaml')
const db = new Low(adapter)
const db = new Low(adapter, {})
```

## Limits
Expand Down

0 comments on commit 1b004c8

Please sign in to comment.