Created
March 17, 2025 18:27
-
-
Save brianc/b5e092325607bf6a010b9af9d8effcc6 to your computer and use it in GitHub Desktop.
esm with pg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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