Best way to do bulk insert into postgresql is to use copy command. High level syntax:
substack/stream-handbook: how to write node programs with streams
Stream | Node.js v14.1.0 Documentation
Streaming SQL in Node.js - ITNEXT
![](https://miro.medium.com/max/4800/1*Luc9Lnb3S0L0RPeuEJ0ghg.jpeg)
Node.js memory limitations - Ashley Davis - Medium
1.4 GB by default
youtube.com/watch?v=FvAghuKuak8&feature=youtu.be