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

loadahmetseledb

v0.1.0

Published

TEK KOMUT (ONE COMMAND) Postgres/Supabase DB snapshot (schema + RLS + indexes)

Downloads

12

Readme

loadahmetseledb

Snapshot your Postgres/Supabase schema, RLS policies, and indexes to clean JSON with one command.

Features

  • Exports one or many schemas (public,auth etc.).
  • Separate JSON outputs for tables, RLS policies, and indexes.
  • SSL on by default; can be disabled for local/self-signed setups.
  • Watch mode to rerun snapshots when migrations change.

Install

  • Global: npm install -g ./loadahmetseledb
  • Project-local: npm install ./loadahmetseledb --save-dev Requires Node 16+.

Quickstart

  1. Add DATABASE_URL to .env or backend/.env (or pass --url).
  2. Run:
npx loadahmetseledb
  1. Outputs land in db/ by default.

CLI Options

--env <path>         Default: .env, backend/.env
--out <dir>          Output directory (default: db)
--schema <list>      Comma-separated schemas (default: public)
--url <DATABASE_URL> Override env var
--no-ssl             Disable SSL
--watch              Watch migrations and auto-snapshot
--help               Show help

Examples:

npx loadahmetseledb --schema public,auth
npx loadahmetseledb --out .ai/db
npx loadahmetseledb --env backend/.env
npx loadahmetseledb --watch --env backend/.env

Output Files

Per schema you get:

  • snapshot.<schema>.schema.json – tables and columns
  • snapshot.<schema>.policies.json – RLS policies
  • snapshot.<schema>.indexes.json – index definitions Each file includes generated_at and is formatted with 2-space JSON for easy diffing.

Watch Mode

--watch listens to:

  • supabase/migrations/**/*.sql
  • migrations/**/*.sql

Any add/change/delete triggers a new snapshot. All other flags (--schema, --out, --url, --no-ssl) still apply.

Backup / History

  • Snapshots overwrite by design; there is no built-in versioning.
  • Best practice: keep the output folder under git and commit changes.
  • For timestamped archives:
    OUT=backups/$(date +%Y%m%d-%H%M%S) && npx loadahmetseledb --out "$OUT"
  • In watch mode, consider a dedicated backups/ path plus periodic commits or tar archives.

Troubleshooting

  • DATABASE_URL missing: set it in .env/backend/.env or pass --url.
  • Connection/timeout issues: check DB reachability and IP allowlist.
  • SSL errors: try --no-ssl for self-signed/local DBs.

Developer Notes

  • ESM-only; import paths include file extensions.
  • Default SSL config uses { rejectUnauthorized: false } for Supabase compatibility.
  • Output directory is created if absent and files are overwritten on each run.