Skip to content

Instantly share code, notes, and snippets.

@brianc
Created March 17, 2025 18:27
Show Gist options
  • Save brianc/b5e092325607bf6a010b9af9d8effcc6 to your computer and use it in GitHub Desktop.
Save brianc/b5e092325607bf6a010b9af9d8effcc6 to your computer and use it in GitHub Desktop.
esm with pg
import pg from "pg";
const client = new pg.Client();
await client.connect();
const { rows } = await client.query("SELECT NOW()");
console.log("rows:", rows);
await client.end();
{
"name": "esmpgtest",
"version": "1.0.0",
"type": "module",
"main": "index.js",
"license": "MIT",
"dependencies": {
"pg": "^8.14.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment