I tried ndjson to improve performance, but using this library is slower than JSON.parse(arrayString), I changed to readline to improve the speed, consider code like the following:
const readline = require('readline');
const fileStream = fs.createReadStream('data.txt');
const rl = readline.createInterface({
input: fileStream,
crlfDelay: Infinity
});
for await (const line of rl) {
JSON.parse(line)
}