A simple example about how to connect to a PostgreSQL database using Node.js
Just run the classic steps:
npm install
npm start
node index.js
See the full step by step: https://javaniceday.com/2019/11/19/how-to-connect-to-a-postgresql-database-in-node-js/