Skip to content

Commit 1b004c8

Browse files
authored
Docs: Fixed outdated examples (#589)
* docs: fix `Low` calls in examples * docs: add missing import * docs: fix import path
1 parent 6fc49cc commit 1b004c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Adapters for reading and writing text. Useful for creating custom adapters.
300300
Adapters for easily supporting other data formats or adding behaviors (encrypt, compress...).
301301

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

346346
```js
347+
import { Low } from 'lowdb'
347348
import { api } from './AsyncStorage'
348349

349350
class CustomAsyncAdapter {
@@ -363,7 +364,7 @@ class CustomAsyncAdapter {
363364
}
364365

365366
const adapter = new CustomAsyncAdapter()
366-
const db = new Low(adapter)
367+
const db = new Low(adapter, {})
367368
```
368369

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

401402
const adapter = new YAMLFile('file.yaml')
402-
const db = new Low(adapter)
403+
const db = new Low(adapter, {})
403404
```
404405

405406
## Limits

0 commit comments

Comments
 (0)