JDBC has "batch updates" feature. You can use single inserts but they're sent as a batch of multiple statements to the database. Not sure about JS libraries, but this feature also significantly improves performance and probably easier to use and maintain.
For super fast inserts you can use postgres COPY feature. But it has to be implemented in the driver.