npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@x-labs-myid/omnistorage

v1.4.0

Published

A lightweight, type-safe, and universal storage layer for JavaScript. Store anything, anywhere, with a single unified API.

Readme

npm version npm downloads docs


Overview

OmniStorage is a pluggable key-value storage library for JavaScript and Node.js. It helps developers work with different storage backends through a consistent, async, and easy-to-use API.

The library is designed for projects that need flexible storage options without rewriting application logic for each environment.

Key Features

  • Universal API — use one consistent interface across browser and Node.js environments.
  • Pluggable engines — supports browser storage, cookies, Cache Storage, in-memory storage, file-based storage, IndexedDB, and SQLite.
  • ORM-like operations — work with familiar storage methods such as create, save, find, update, and delete.
  • Type-safe retrieval — validate data types when reading stored values.
  • Namespacing support — organize and isolate data across apps, modules, or features.
  • Standard responses — receive predictable operation results with status, message, engine, and timestamp information.
  • Activity logging — track storage operations in the omnistorage_logs SQLite table for debugging and auditing.
  • Hooks and watchers — react to storage changes when data is created, updated, read, or deleted.

Installation

Install from npm:

npm install @x-labs-myid/omnistorage

Use it in your project:

import store from "@x-labs-myid/omnistorage";

Client-side setup

Use browser-safe engines for frontend apps: local, session, cookie, cache, indexeddb, memory, or sqlite-client.

import store from "@x-labs-myid/omnistorage";

store.db("todo_app").use("indexeddb");
// Optional: force browser SQLite WASM for logs.
store.configureLogs("client");

await store.save("theme", { mode: "dark" });
const theme = await store.find("theme");

For browser SQLite storage, use sqlite-client:

store.db("todo_app").use("sqlite-client");
await store.save("draft:1", { title: "Offline note" });

Server-side setup

Use Node.js-only engines on the server: file or sqlite-server.

import store from "@x-labs-myid/omnistorage";

await store.init({
  db: {
    name: "omnistorage",
    engine: "sqlite",
  },
  logs: "auto",
});

await store.save("user:1", { name: "Cahya" });
const user = await store.find("user:1");

If the configured database already exists, OmniStorage reuses it and only creates the omnistorage_kv and omnistorage_logs tables when needed.

Vite and browser bundlers

OmniStorage works in Vite without aliasing Node.js modules to empty files. Node-only dependencies such as better-sqlite3 and node:fs are loaded lazily only when Node-only engines (file or sqlite-server) are used at runtime.

A normal Vite config is enough:

import { defineConfig } from "vite";

export default defineConfig({});

Supported Engines

OmniStorage supports multiple engines across browser, Node.js, and shared runtime use cases:

  • Runtime-aware: sqlite — resolves to sqlite-client in browsers and sqlite-server in Node.js
  • Hybrid / Universal: memory — native JavaScript Map, no third-party cache dependency
  • Client-side / Browser: local, session, cookie, cache, indexeddb, sqlite-client
  • Server-only / Node.js: file, sqlite-server

Storage naming

OmniStorage uses OmniStorage-scoped names for internal persistence objects:

  • SQLite key-value data is stored in the omnistorage_kv table.
  • Activity logs are stored in the omnistorage_logs table.
  • IndexedDB stores key-value data in the omnistorage_kv object store.
  • The file engine stores JSON files under .omnistorage/.

For SQLite engines, .db(name) sets the logical database name. If the matching database already exists, OmniStorage reuses it and only creates the OmniStorage table when needed. If it does not exist, SQLite creates it.

Activity logging defaults to auto mode: Node.js/server runtimes use sqlite-server, browser/client runtimes use sqlite-client with SQLite WASM, and mixed client/server projects keep browser logs on SQLite WASM. You can configure global setup either with init() or the chainable API:

await store.init({
  db: {
    name: "omnistorage",
    engine: "sqlite",
  },
  logs: "auto",
});

store
  .use({
    db: {
      name: "omnistorage",
      engine: "sqlite",
    },
  })
  .configureLogs("auto");

Documentation

Detailed installation guides, API reference, engine configuration, and advanced examples are available on the official documentation site:

👉 OmniStorage Official Documentation

Development

Install project dependencies first:

npm install

Run the documentation locally

The documentation is a static site inside the docs/ directory. Serve the project root with any local HTTP server, then open the docs page in your browser.

Using Python:

python -m http.server 8000

Or using serve via npx:

npx serve .

Then open:

http://localhost:8000/docs/

If you use npx serve ., open the local URL printed in the terminal and go to /docs/.

Playground:

http://localhost:8000/docs/playground/

Avoid opening docs/index.html directly with file:// because the docs load Markdown files with fetch(), which requires an HTTP server in most browsers.

Run checks and tests

Run the source syntax check/build command:

npm run build

Run the configured typecheck command:

npm run typecheck

Run all tests:

npm test

Run a specific test file:

npm test -- tests/omnistorage.test.js

License

MIT