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

scdb-web

v1.0.4

Published

A secure SQLite-based database with a web panel, terminal CLI, and Node.js client. Uses **sql.js** (no native build). Features authentication, RBAC, and audit logging.

Downloads

304

Readme

Secure DB

A secure SQLite-based database with a web panel, terminal CLI, and Node.js client. Uses sql.js (no native build). Features authentication, RBAC, and audit logging.

Structure

  • packages/core – sql.js DB, parameterized queries, auth, audit
  • packages/api – HTTP API (exportable createApp) + serves web panel
  • packages/web – One-line embed: import { init } from 'scdb-web'; init(env);
  • packages/lib – Node.js client (createClient, query, execute)
  • packages/web-panel – Panel assets (HTML/CSS/JS) served by API
  • packages/cli – Terminal CLI (interactive + one-shot)

Setup

  1. Copy .env.example to .env and set DATABASE_PATH and SESSION_SECRET.
  2. Run npm install in the project root.
  3. Start the server: npm start (API + panel at http://localhost:3000).
  4. First time: open http://localhost:3000 and use First-time setup to create an admin user, then log in.
  5. Create an API key (for CLI/lib): as admin, call POST /api-keys with body { "name": "cli", "role": "readwrite" }. Use the returned key in SECURE_DB_API_KEY.

Usage

  • Web panel: Open http://localhost:3000 — Tables, SQL editor, Audit log (admin).
  • CLI: SECURE_DB_API_KEY=yourkey npm run cli for interactive mode; npm run cli -- run "SELECT 1" or npm run cli -- run -f query.sql for one-shot.
  • Node.js: import { createClient } from 'scdb-lib'; const client = createClient({ url: 'http://localhost:3000', apiKey: '...' }); const rows = await client.query('SELECT * FROM users', []);

Integrating in other Node.js projects

  • Web (API + panel)
    Install and start the server with one call:

    npm install scdb-web
    import { init } from 'scdb-web';
    init({ port: 3000, databasePath: './data/app.sqlite', sessionSecret: 'your-secret' });

    Optional env keys: port, host, databasePath, sessionSecret, docsDir.

  • CLI
    Install and run with env (or add to your package.json scripts):

    npm install scdb-cli
    SECURE_DB_API_KEY=xxx SECURE_DB_API_URL=http://localhost:3000 npx secure-db
    SECURE_DB_API_KEY=xxx npx secure-db run "SELECT 1"
    SECURE_DB_API_KEY=xxx npx secure-db run -f script.sql

Security

  • Auth: API keys and/or username/password; passwords hashed with bcrypt.
  • RBAC: admin, readwrite, readonly.
  • All queries are parameterized; audit log records who ran what and when.
  • Use HTTPS in production.

Documentation

  • Admin guide: operational steps, creating users and API keys, using the web panel, backups, and security notes – see docs/ADMIN_GUIDE.md.
  • User/developer guide: how to use the CLI and Node.js client, and how roles affect what you can do – see docs/USER_GUIDE.md.