JSON Lines data import

If you don’t need fancy (streaming etc) and the JSON elements don’t contain line breaks, you can use the following function

parse = t => t.split("\n")
    .filter(s => s !== "")
    .map(s => JSON.parse(s))
1 Like