JSPM

@nepse-toolkit/store

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q51984F
  • License MIT

SQLite storage layer for NEPSE toolkit with migrations and WAL mode

Package Exports

  • @nepse-toolkit/store

Readme

@nepse-toolkit/store

SQLite storage layer for NEPSE toolkit — local-first persistence for market data and portfolio.

Part of the nepse-toolkit monorepo.

Features

  • SQLite database via better-sqlite3 with WAL mode for concurrent reads
  • Auto-migrations — schema versioning with automatic upgrades
  • OHLCV storage — historical price data with date-range queries
  • Portfolio — positions, watchlists, and price alerts
  • Local-first — data stored at ~/.nepse-toolkit/nepse.db for offline analysis

Install

npm install @nepse-toolkit/store

Usage

import { NepseDatabase } from "@nepse-toolkit/store";

const db = new NepseDatabase();

// Store and query OHLCV data
db.upsertOHLCV("NABIL", ohlcvData);
const history = db.getOHLCV("NABIL", "2024-01-01", "2024-12-31");

// Portfolio management
db.addPosition("NABIL", 100, 850, "2024-06-15");
const positions = db.getPositions();

// Watchlists
db.addToWatchlist("banking", "NABIL");
const watchlist = db.getWatchlist("banking");

Note: Uses better-sqlite3 (native addon). Requires Node.js — not compatible with Bun runtime.

License

MIT