zapier-async-storage

Minimalist wrapper for IndexedDB

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
zapier-async-storage
1.0.05 years ago6 years agoMinified + gzip package size for zapier-async-storage in KB

Readme

zapier-async-storage
Minimalist wrapper for IndexedDB

Usage

npm install zapier-async-storage

import { createInstance } from 'zapier-async-storage';

const db = createInstance({
  storeName: 'my-store',
  dbName: 'AsyncStorage',
  version: 1,
});

db.setItem('hello', 'world')
  .then(db.getItem('hello'))
  .then((result) => {
    console.log(result); // 'world'
  });

Configuration

WIP.

Development

npm run start
open http://localhost:8001/__tests__/

Navigate to http://localhost:8001/__tests__ to view the Mocha test suite.

Browser Compatibilty

This library uses modern JS features like Object.assign and Promise, so for compatibilty with older browsers (i.e., IE), you'll need an appropriate polyfill.