New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

litemap

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

litemap

A TypeScript library for mapping and processing data with SQLite integration

latest
Source
npmnpm
Version
1.38.0
Version published
Maintainers
1
Created
Source

Litemap

A lightweight, persistent key-value database for Node.js, designed for simple user and item storage with SQLite as the backend. Litemap provides an easy-to-use API for managing users, items, and other records, making it ideal for bots, and other various apps.

npm npm version license GitHub stars

Features

  • 💾 Persistent storage – Data is saved to disk using SQLite.
    • Any updates to the database will be stored in a queue to prevent "transcation within a transaction"
  • 🔑 Key-value access – Store and retrieve users/items by key.
  • 🏎️ Fast and lightweight – Minimal dependencies, quick operations.
    • SQLite
    • SQLite3
  • 🤖 Perfect for bots – Designed for Discord bots and automation scripts.

Installation

npm install litemap

Usage

const { DatabaseFactory } = require("litemap");
const fs = require("fs/promises");

(async () => {
  await fs.mkdir("./db", { recursive: true });
  const dbManager = DatabaseFactory.Instance("./db/litemap.db");

  if (!(await dbManager.getUser("user1"))) {
    await dbManager.addUsers([
      {
        key: "user1",
        value: {
          name: "Mad Hatter",
          role: "superadmin",
          email: "test@example.com",
          createdAt: new Date().toISOString(),
          lastLogin: null,
        },
      },
    ]);
  } else {
    console.log("user1 already exists, skipping creation.");
    if (
      (await dbManager.getUser("user1").lastLogin) !== new Date().toISOString()
    ) {
      await dbManager.updateUser("user1", {
        lastLogin: new Date().toISOString(),
      });
      console.log("Updated last login for user1.");
    }
    dbManager.getUser("user1").then((user) => {
      console.log("Current user1 data:", user);
    });
  }
})();

Exports

const { DatabaseFactory, SQLiteDatabase, UserDatabaseManager } = require("litemap");

Types

You can import types for TypeScript:

import type { IUserRecord, UserRecord } from "litemap";

Example Use Cases

  • Discord bots: Store user profiles, stats, and settings.
  • CLI tools: Save configuration or user data.
  • Web apps: Lightweight persistent storage without a full database server.
  • Prototyping: Quickly persist data during development.

Keywords

typescript

FAQs

Package last updated on 18 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts