Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Fixed outdated examples #589

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,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 @@ -335,6 +335,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 @@ -354,7 +355,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 @@ -390,7 +391,7 @@ class YAMLFile {
}

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

## Limits
Expand Down
Loading