@joshdb/indexeddb

1.0.3 • Public • Published

IndexedDB Provider for JOSH

The IndexedDB provider uses javascript IndexedDB api to store a database in browser

Running the installer

In your project folder, you should be able to install using this command:

npm i @joshdb/indexeddb
** OR **
yarn add @joshdb/indexeddb

Usage

Using the IndexedDB provider goes as such:

Webpack

const Josh = require('@joshdb/core');
const JoshIndexedDB = require('@joshdb/indexeddb');

const db = new Josh({
  name: 'testing',
  provider: JoshIndexedDB,
  // See below for all provider options.
  providerOptions: {},
});

db.defer.then(async () => {
  console.log(`Connected, there are ${await db.size} rows in the database.`);
});

CDN

<script src="https://unpkg.com/@joshdb/core"></script>
<script src="https://unpkg.com/@joshdb/indexeddb@latest/dist/main.js"></script>
<script>
  const Josh = require('josh');
  const JoshIndexedDB = require('@joshdb/indexeddb');

  const db = new Josh({
    name: 'testing',
    provider: JoshIndexedDB,
    // See below for all provider options.
    providerOptions: {},
  });

  db.defer.then(async () => {
    console.log(`Connected, there are ${await db.size} rows in the database.`);
  });
</script>

Provider Options

Param Type Description
[providerOptions] Object The Provider Options Object

Readme

Keywords

none

Package Sidebar

Install

npm i @joshdb/indexeddb

Weekly Downloads

0

Version

1.0.3

License

Apache-2.0

Unpacked Size

59.1 kB

Total Files

11

Last publish

Collaborators

  • eslachance