🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@joshdb/indexeddb

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@joshdb/indexeddb

JSON Provider for JOSH

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

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

ParamTypeDescription
[providerOptions]ObjectThe Provider Options Object

FAQs

Package last updated on 14 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts