Store and query user session data in a browser app without making API calls by keeping it in a LokiJS collection
Build a high-speed search feature in a Node.js app using binary indexes capable of 500K operations per second
Add a local data cache to a mobile app built with NativeScript or Cordova that persists through the session
Track live data changes in a dashboard using dynamic views that update automatically as records are added or modified
LokiJS is an in-memory database written in JavaScript that stores data as documents rather than in rows and tables. You give it JavaScript objects and it saves them in memory, letting you query and retrieve them quickly without setting up a separate database server. It runs in web browsers, in Node.js, and in mobile app frameworks like NativeScript and Cordova/PhoneGap. The library is designed for situations where speed matters more than permanent storage, or where you want to keep data in memory during a session and save it elsewhere when done. Common use cases listed in the README include session stores, performance-critical apps, mobile apps that need to avoid calling native device databases, and desktop apps built with web technologies. It achieves fast query speeds by maintaining indexes on the data: a unique index handles about 1.1 million operations per second, and a binary index about 500,000. Features include dynamic views, which are live subsets of a collection that update automatically as data changes, a built-in persistence layer with support for custom adapters so you can write data out to disk or another store when needed, a changes API for tracking modifications, and basic join operations between collections. Installation is through npm for Node.js environments or by including a single JavaScript file in the browser. A sandbox playground was available for trying it out without any setup. The project is MIT licensed and was at version 1.3 at the time the README was last updated. Commercial support and a planned roadmap toward MongoDB API compatibility and horizontal scaling are also mentioned.
← techfort on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.