Instagres
Instant Postgres. No signup required. Powered by Neon.
CLI Usage
To get started, run one of the commands below.
This will give you a Postgres connection string and add it to a .env
file.
(You need one of Node.js / Bun / Deno installed.)
npx instagres
yarn dlx instagres
pnpx instagres
bunx instagres
deno run -A npm:instagres
Available options:
--file : Path to the .env file - defaults to .env
--name : Environment variable key for the connection string in the .env file - defaults to DATABASE_URL
--pooler : Get a connection string to a connection pooler - not enabled by default
Library usage
npm install instagres
yarn add instagres
pnpm install instagres
bun install instagres
Use the instagres
async function to retrieve an instant Postgres connection string from Instagres. If the DATABASE_URL
(or a custom key) is not already set in your specified .env
file, the function will:
- Prompt the user to generate a new connection string.
- Save the generated connection string to the specified
.env
file
(defaults to .env
) under the specified key (defaults to DATABASE_URL
) - Return the connection string.
import instagres from "instagres";
const { default: instagres } = require("instagres");
import instagres from "npm:instagres@^1.1.4";
const connectionString = await instagres({ source: "my-cool-project" });
const connectionString = await instagres({
dotEnvFile: ".env",
dotEnvKey: "DATABASE_URL",
withPooler: false,
source: "my-cool-project",
});