cieszynski.de back

development - latest posts  #1

recent posts #1

A promise-based and transactional wrapper for indexedDB

JSxdb is a small JavaScript library that provides a promise‐based and transactional wrapper around IndexedDB. It aims to make working with IndexedDB easier by offering higher-level abstractions: open databases, read and write with transactions, query/filter capabilities, etc.

Key features

  1. Database opening / schema definition

    You define a versioned schema when opening the database the first time.

  2. Transactional writes & reads

    You can perform write transactions (single or multiple object stores) and commit or abort them. Similarly, reads are done inside transactions (important if you write data based on reads).

  3. Filtering queries, updates and deletes

    Methods such as .where(), .and(), .or(), .limit() and .reverse(), which allow you to filter by properties in order to perform operations such as .query(), .update() or .delete().

  4. Promise-based API

    All operations return promises (or use async/await). This makes the API more ergonomic compared to raw IndexedDB with its event-based callbacks.

Example usage und more information on the github project page.

Powershell: WebView2Runner

Sometimes you want to start a WebApp as a desktop application. Fortunately, Chromium/Edge is available as a browser engine for this - called WebView2. To keep the use as simple and universal as possible, here is this Powershell script and the necessary information.

Today you can start a WebApp as a BowserApp with a manifest file. With this script you are able to start your application in foreground and full screen mode and intercept certain key combinations. This enables you to start your WebApp in kiosk mode.

At the moment this script is only useful for Windows. But if WebView2 is also available for other OS, it should not be a problem to transfer the implementation to other OS.

Example usage und more information on the github project page.