DexBee is a simple lightweight indexedDB framework for easy setup and indexing.
Add script tag inside <head></head>
<script src="https://cdn.jsdelivr.net/npm/dexbee@latest/dist/dexbee.js"></script>
npm i dexbee
And in your javascript:
import DexBee from 'dexbee';
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();
Check out Getting Started tutorial from our website dexbee.io
Post bugs and feature requests Here.
Any Contributions are welcomed :)
MIT License.
Copyright (c) 2021-present, broadway Inc.