Export PostgreSQL data to CSV file using Node.js

Previous tutorial shows you how to use Node.js to import CSV data into a PostgreSQL Database table. Today we’re gonna do the opposite: Export PostgreSQL data to CSV file. There are 2 steps:

  • Read PostgreSQL data using pg module
  • Export PostgreSQL data to CSV file using one of three modules: fast-csv, csv-writer or fs

Rest API: Node.js Download CSV file example
Dockerize: Docker Compose Nodejs and Postgres example

Read More

Export MySQL data to CSV file using Node.js

In previous tutorial, we’ve known how to use Node.js to import CSV data into MySQL Database table. Today you’re gonna look at way to do the opposite: Export MySQL data to CSV file. The process has 2 steps:

  • Read MySQL data using mysql module
  • Export MySQL data to CSV file using one of three modules: fast-csv, csv-writer or fs

Rest API: Node.js Download CSV file from MySQL Database example

Read More