Node.JS: Using spawn to import a database

Example 1: background process: File api.js Example link: Example 2: event when import done File api.js: Example link:

Javascript: How to read file with FileReader

We can use method readAsBinaryString or readAsText to read file. Example 1: readAsBinaryString Online demo: Example 2: readAsText Demo online: