Skip to content

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
talaikis committed Aug 23, 2019
1 parent c0e0800 commit 2cac173
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is simple, no dependencies, local disk, table-level Node.js JSON database,
## Install

```bash
npm i json-local-db
npm i @talaikis/json-db
```

## Fucntions
Expand All @@ -15,42 +15,42 @@ All functions need `baseDir`, where the database is stored. For example: `join(_
### Create item in a table

```js
import { create } from 'json-local-db'
import { create } from '@talaikis/json-db'
await create(baseDir, table, itemName, jsonData).catch((e) => ...)
```

### Read item from the table

```js
import { read } from 'json-local-db'
import { read } from '@talaikis/json-db'
const jsonData = await read(baseDir, table, itemName).catch((e) => ...)
```

### Update the item in a table

```js
import { update } from 'json-local-db'
import { update } from '@talaikis/json-db'
await update(baseDir, table, itemName, newJsonData).catch((e) => ...)
```

### Delete item from the table

```js
import { destroy } from 'json-local-db'
import { destroy } from '@talaikis/json-db'
await destroy(baseDir, table, itemName).catch((e) => ...)
```

### List table items

```js
import { list } from 'json-local-db'
import { list } from '@talaikis/json-db'
await list(baseDir, table).catch((e) => ...)
```

### Delete table

```js
import { destroyTable } from 'json-local-db'
import { destroyTable } from '@talaikis/json-db'
await destroyTable(baseDir, table).catch((e) => ...)
```

Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-local-db",
"version": "1.0.0",
"name": "@talaikis/json-db",
"version": "1.0.1",
"description": "No dependencies local JSON database.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -39,5 +39,9 @@
"pre-commit": "npm run test",
"pre-push": "npm run test"
}
}
},
"directories": {
"test": "test"
},
"dependencies": {}
}

0 comments on commit 2cac173

Please sign in to comment.