Skip to content

Commit

Permalink
Bumped version
Browse files Browse the repository at this point in the history
Updated readme
  • Loading branch information
julienetie committed Feb 13, 2024
1 parent 468bf86 commit 941b598
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<img src="https://github.com/julienetie/db64/assets/7676299/29665616-14d5-4e14-a3ff-191cc6aae7fa" width="200">

## A Practical IndexedDB API

> ### Disclaimer
> Starting from version 0.8.5, before creating a new databse, the function `db64.create(<database>,[<store>,<store>,...])` will now automatically delete the existing specified database if it does not contain the exact specified stores.
> If you do not want this behavior, set the third argument to `disable-delete` e.g. `db64.create('db', ['x', 'y'], 'disable-delete')`
### [Example](https://julienetie.github.io/db64/examples/input-data/)

A more practical alternative to [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). db64 supports [all major browsers](https://caniuse.com/indexeddb).
Expand Down Expand Up @@ -68,9 +73,20 @@ import db64 from 'db64' // ES
const db64 = require('db64') // CommonJS
```
**Create a database with stores** _(string, array)_
**Create a database with stores** _(string, array, string)_
```javascript
await db64.create('game-consoles', ['n64', 'ps5', 'dreamcast', 'xbox-360'])
// or
await db64.create(..., ..., 'disable-delete')
```
By default, if the database to create exists but dosn't have the expected stores, it will be deleted before being re-created.
This can be disabled by using the `'disable-delete'` string.
**Check if a database has a store** _(string, string | array)_
```javascript
const hasN64 = async db64.has('game-consoles', 'n64')
// or
const hasStores = async db64.has('game-consoles', ['n64', 'dreamcast', 'ps5'])
```
**Use a store** _(string, string)_
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "db64",
"version": "0.8.5",
"version": "0.8.6",
"description": "A Practical IndexedDB API",
"main": "db64.js",
"type": "module",
Expand Down

0 comments on commit 941b598

Please sign in to comment.