zapier-async-storage
v1.0.0
Published
Minimalist wrapper for IndexedDB
Downloads
842
Keywords
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.