Working with CSV in NodeJS in 2 Minutes

Jack Yeh
TeamZeroLabs
Published in
2 min readJan 26, 2020

--

I need to 1) read 2) write to 3) filter out columns with a small CSV, this guide is for you!

tl;dr: The final repo is here: https://github.com/teamzerolabs/node-csv-example.

Quick and Dirty — Convert CSV into JSON

  • yarn add neat-csv
  • Load the csv string with fs and fs.readFileSync
async function readCSV(content) {
const result = await neatCsv(content);
return result;
}

--

--

Jack Yeh
TeamZeroLabs

I monitor your full stack deployment in production, so you can sleep at night. Docker | Kubernetes | AWS | Prometheus | Grafana