1. const fs = require('fs')
    2. module.exports.parser = path => {
    3. const readStream = fs.createReadStream(path)
    4. let reqData = [];
    5. let buffer
    6. return new Promise(resolve => {
    7. readStream.on("data", function (data) {
    8. reqData.push(data);
    9. });
    10. readStream.on("end", function () {
    11. buffer = Buffer.concat(reqData)
    12. resolve(JSON.parse(buffer.toString()))
    13. })
    14. })
    15. }