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

get-db

v0.13.0

Published

create a claimable Neon database in seconds!

Readme


CLI Usage

The CLI provides a default referrer value, so the --ref flag is optional.

| Package Manager | Command | | --------------- | --------------------- | | npm | npx get-db | | pnpm | pnpx get-db | | yarn | yarn dlx get-db | | bun | bunx get-db | | deno | deno run npm:get-db |

npx get-db [options]

Options:

  • -y, --yes Use defaults, skip prompts
  • -e, --env Path to .env file (default: ./.env)
  • -k, --key Env key for connection string (default: DATABASE_URL)
  • -p, --prefix Prefix for public env vars (default: PUBLIC_)
  • -r, --ref Referrer identifier for tracking (default: npm:get-db/cli)
  • -s, --seed Path to SQL file to execute after database creation
  • -L, --logical-replication Enable logical replication (default: false)
  • -h, --help Show help

SDK/API Usage

Import the SDK:

import { instantPostgres } from "get-db/sdk";

Create a claimable Neon Postgres database and save credentials to your .env:

await instantPostgres({
	referrer: "your-cli-package-name", // REQUIRED
	dotEnvFile: ".env",
	dotEnvKey: "DATABASE_URL",
	envPrefix: "PUBLIC_",
	settings: {
		logicalReplication: false, // Enable logical replication
	},
	// This referrer parameter helps us understand where usage comes from.
	// If you're publishing a library, we'd love that you re-expose a
	// referrer parameter in your lib and set this to `npm:your-lib-package-name|${referrer}`
	// So we can understand the chain better and give you all the credit you deserve!
});

| Option | Default | Description | Required | Validation | | ---------- | -------------- | ---------------------------------- | -------- | --------------------- | | referrer | - | Referrer identifier | Yes | - | | dotEnvFile | ".env" | Path to env file | No | letters and . | | dotEnvKey | "DATABASE_URL" | Environment variable name | No | `SCREAMING_SNAKE_CASE | | envPrefix | "PUBLIC_" | Prefix for public environment vars | No | - | | settings | - | Database configuration settings | No | - |

settings Options

| Property | Type | Description | Default | | ------------------- | ------- | ------------------------------ | ------- | | logicalReplication| boolean | Enable logical replication | false |

Note: The Vite plugin uses VITE_ as the default envPrefix to match Vite's convention for client-side environment variables.

Returns:

| Property | Description | | ------------------- | --------------------------------------------- | | databaseUrl | Pooled connection string (default connection) | | databaseUrlDirect | Direct connection string | | claimUrl | Claim link | | claimExpiresAt | Expiration date |

Environment Variables Written

When you run get-db, the following environment variables are written to your .env file:

| Variable | Description | | -------------------------------- | -------------------------------------------------------- | | DATABASE_URL | The pooler connection string (default connection) | | DATABASE_URL_DIRECT | The direct connection string | | {envPrefix}POSTGRES_CLAIM_URL | Claim URL (valid for 72 hours) to take ownership of the DB |

Note: The pooler connection is now the default for DATABASE_URL (as of the latest version). The pooler provides connection pooling and is recommended for most use cases, especially serverless environments.


Types

// Params for instantPostgres
interface InstantPostgresParams {
	referrer: string; // Required
	dotEnvFile?: string;
	dotEnvKey?: string;
	envPrefix?: string;
	seed?: { type: "sql-script"; path: string };
	settings?: {
		logicalReplication?: boolean; // Enable logical replication (default: false)
	};
}

See documentation on Neon for more.


This package was templated with create-typescript-app using the Bingo engine.