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

@nepse-toolkit/store

v0.2.5

Published

SQLite storage layer for NEPSE toolkit with migrations and WAL mode

Readme

@nepse-toolkit/store

SQLite persistence layer for NEPSE toolkit data and operations.

Part of the nepse-toolkit monorepo.

Overview

  • Local-first SQLite database (better-sqlite3, WAL mode)
  • Auto-applied migrations
  • Storage for prices, floorsheet, fundamentals, watchlists, portfolio, and alerts
  • Persistent provider payload telemetry history and dashboard aggregation
  • Persistent telemetry anomaly sink and ack/silence control state
  • Telemetry retention pruning and dead-letter persistence for failed alert deliveries

Install

npm install @nepse-toolkit/store

Quick Start

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

const db = new NepseDatabase();

db.upsertDailyPrices(ohlcvData);
const history = db.getDailyPrices("NABIL", {
  from: "2024-01-01",
  to: "2024-12-31",
});

db.addPosition("NABIL", 100, 850, "2024-06-15");
const positions = db.getPortfolio();

db.insertPayloadTelemetrySnapshots(liveSnapshots);
const dashboard = db.getPayloadTelemetryDashboard({ hours: 24, topEndpoints: 20 });
const pruneResult = db.prunePayloadTelemetryHistory({ retentionDays: 30 });

const sink = db.upsertPayloadTelemetryAlertSink({
  type: "webhook",
  target: "https://alerts.example.com/webhook",
  enabled: true,
});

const control = db.upsertPayloadTelemetryAlertControl({
  provider: "nepse",
  endpoint: "/api/nots/nepse-data/marketdepth/131",
  silencedUntil: new Date(Date.now() + 60_000).toISOString(),
  note: "known noisy endpoint",
});

const deadLetter = db.insertPayloadTelemetryAlertDeadLetter({
  provider: "nepse",
  endpoint: "/api/nots/nepse-data/marketdepth/131",
  sinkType: "webhook",
  sinkTarget: "https://alerts.example.com/webhook",
  payload: { event: { provider: "nepse" } },
  attempts: 3,
  maxAttempts: 3,
  lastError: "HTTP 500 upstream error",
});

const unresolvedDeadLetters = db.listPayloadTelemetryAlertDeadLetters({
  unresolvedOnly: true,
  limit: 50,
});

Runtime Note

@nepse-toolkit/store uses better-sqlite3 (native addon), so use Node.js runtime for this package.

Development

bun --filter @nepse-toolkit/store run build
bun --filter @nepse-toolkit/store run typecheck
node --import tsx --test packages/store/tests/database.test.ts

License

MIT