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

@acegalaxy/db-gateway

v0.1.2

Published

Multi-DB adapter (Postgres + SQLite + Notion) with a 5-layer default-deny security gateway: identity, policy authz (YAML), rate-limit, append-only audit log.

Readme

@acegalaxy/db-gateway

npm version npm downloads License: MIT Node

Multi-database adapter with a 5-layer default-deny security gateway for PostgreSQL, SQLite, and Notion. Funnel every DB call through one entry point with identity, policy authz, rate-limit, and append-only audit log.

Why

Ad-hoc DB calls scattered across a codebase are impossible to audit and easy to abuse. db-gateway centralizes access so every query passes the same checks:

  • Who is calling (identity resolution)
  • What they may touch (policy YAML, per-table/column)
  • How fast they may call (rate-limit / pool)
  • What happened (append-only audit log)

The gateway never throws; it returns { outcome, denyReason, rows?, latencyMs }.

Install

npm install @acegalaxy/db-gateway

Requires Node.js >= 20.

Quick start

PostgreSQL

const { Gateway } = require('@acegalaxy/db-gateway');

const gw = Gateway.create({
  adapter: 'postgres',
  connection: { host: 'localhost', database: 'app', user: 'app' },
  policyPath: './policies/schema.yaml',
  identity: (ctx) => ({ service: ctx.service, scope: ctx.scope }),
  audit: (entry) => console.log(JSON.stringify(entry)),
});

const res = await gw.query(
  { op: 'select', table: 'users', where: { id: 42 } },
  { service: 'web-api', scope: 'read' },
);
// { outcome: 'allow', rows: [...], latencyMs: 3 }

Notion

const gw = Gateway.create({
  adapter: 'notion',
  connection: { token: process.env.NOTION_TOKEN },
  policyPath: './policies/notion.yaml',
  identity: (ctx) => ctx,
  audit: writeAuditLog,
});

const res = await gw.query(
  { op: 'page.update', pageId: 'abc...', props: { Status: 'Done' } },
  { service: 'sync-bot', scope: 'write' },
);

Adapters

| Adapter | Driver | Status | | ---------- | --------------------- | ------ | | postgres | pg | beta | | sqlite | better-sqlite3 | beta | | notion | @notionhq/client | beta |

Security layers

Caller
  │
  ▼
[L2] Identity resolver       ── who is this caller?
  │
  ▼
[L3] Policy authz (YAML)     ── may they touch this table/column?
  │
  ▼
[L4] Rate-limit + pool       ── too many calls? back off.
  │
  ▼
[L5] Audit log (append-only) ── record outcome + latency
  │
  ▼
[L1] Adapter (driver call)   ── only place that imports pg / sqlite / notion

Default-deny: missing policy entry = deny. Hard DELETE is blocked on tables with soft_delete policy. notion.pages.delete() is never called — archive only.

License

MIT © 2026 ACE Galaxy

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md. Security issues: see SECURITY.md.