AsyncDB is a lightweight wrapper on top of async-local-storage which allows to have a simple and async localStorage without having to deal with as said: all the performance hazards of localStorage..
All credits goes to async-local-storage API and of course lodash.
Install with Bower:
bower install --save asyncdb
The component can be used as a CommonJS module, an AMD module, or a global.
To use AsyncDB in your JavaScript code, you could simply add it as a script tag:
<scriptsrc="asyncdb.js"></script>Or require it as an AMD or CommonJS module. Then you could use it like:
varAsyncDB=require('asyncdb'),db=AsyncDB.load(['users','apps']);db.users.insert({}).then(function(userId){});db.users.findOne({}).then(function(user){});db.apps.findOne({}).then(function(app){});or using ES6 function generators and yield keyword and a helper library like DefineJS or co:
varuserId=yielddb.users.insert({});varuser=yielddb.users.findOne({});varapp=yielddb.apps.findOne({});It is all about making it easy to store offline data in the browser.