postgres nodejs npm code example
Example 1: npm postgres
npm install pg knex
Example 2: postgresql nodejs
const { Client } = require('pg')const client = new Client();(async () => { await client.connect() const res = await client.query('SELECT $1::text as message', ['Hello world!']) console.log(res.rows[0].message) // Hello world! await client.end()})()