0.1.6 • Published 11 months ago
dexbee v0.1.6
DexBee
DexBee is a simple lightweight indexedDB framework for easy setup and indexing.
Installation
CDN
Add script tag inside <head></head>
<script src="https://cdn.jsdelivr.net/npm/dexbee@latest/dist/dexbee.js"></script>
Webpack
npm i dexbee
And in your javascript:
import DexBee from 'dexbee';
Basic usage
async function main() {
let data = [{id: 1, name: 'Tom'}, {id: 2, name: 'Jerry'}];
// Setup database:
let db = new DexBee({Cartoon: {TomNJerry: {uniqueKey: 'id', index: 'name'}}});
// Write to database:
await db.put('Cartoon', 'TomNJerry', data);
// Get data:
let jerry = await db.get('Cartoon', 'TomNJerry', {
where: {name: 'Jerry'}
});
console.log(jerry); // logs [ [{ id: 2, name: 'Jerry'}] ]
}
main();
Documentation
Check out Getting Started tutorial from our website dexbee.io
Issues
Post bugs and feature requests Here. Any Contributions are welcomed :)
License
MIT License. Copyright (c) 2021-present, broadway Inc.