get-db
CLI to help you hit the ground running without any sign-up. Instantiate a database with a single-command!
Note: This package was previously named neondb. The old package is now deprecated. If you're upgrading from neondb, simply replace it with get-db in your commands and imports.
Usage
npx get-db
CLI Usage
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_)
-s, --seed Path to SQL file to execute after database creation
-h, --help Show help
SDK/API Usage
Import the SDK:
import { instantNeon } from "get-db/sdk";
Create a claimable Neon Postgres database and save credentials to your .env:
await instantNeon({
dotEnvFile: ".env",
dotEnvKey: "DATABASE_URL",
envPrefix: "PUBLIC_",
referrer: "npm:your-cli-package-name",
});
| dotEnvFile | ".env" | Path to env file | letters and . |
| dotEnvKey | "DATABASE_URL" | Environment variable name | `SCREAMING_SNAKE_CASE |
| envPrefix | "PUBLIC_" | Prefix for public environment vars | - |
| referrer | "unknown" | Referrer identifier | - |
Note: The Vite plugin uses VITE_ as the default envPrefix to match Vite's convention for client-side environment variables.
Returns:
databaseUrl | connection string |
poolerUrl | pooled connection string |
claimUrl | claim link |
claimExpiresAt | expiration date |
Types
interface InstantNeonParams {
dotEnvFile?: string;
dotEnvKey?: string;
envPrefix?: string;
referrer?: string;
}
See documentation on Neon for more.
This package was templated with create-typescript-app using the Bingo engine.