When I made this, I was no stranger to JavaScript or working with databases - including NoSQL - but had no experience with IndexedDB Web API, specifically. So, I used this to learn it. I hope you enjoy my experiment.
I noticed quickly that the Request objects could be easily replaced with Promises, so I created a list of decorator classes I dubbed "AsyncIDB". The core change I added was the use of Async
After thinking deeper about the versioning process, I figured it would be useful to create schema migrations and seed the data, just like you might do with an API/server-side logic.
IDBCursors really threw me for a loop (pun 100% intended). I knew Observables were push-based but figured I could still accomplish the same results with an async generator function. That is, until I found callback-to-async-iterator.
- Manually install Node or use the included Dockerfile (see below)
npm install
npm start
docker build -t async-indexeddb .
docker run --rm -it -v [cd]:/app -p 3000:3000 async-indexeddb
, replacing[cd]
depending on your environment:
- CMD:
%CD%
- PowerShell:
${PWD}
- Linux/MacOS Terminal:
$(pwd)