metaforecast/node_modules/json2csv/bin/utils/parseNdjson.js
2021-01-12 13:43:41 +01:00

12 lines
208 B
JavaScript

'use strict';
function parseNdJson(input) {
return input
.split('\n')
.map(line => line.trim())
.filter(line => line !== '')
.map(line=> JSON.parse(line));
}
module.exports = parseNdJson;