Skip to content

csv

Reading JSON

const fs = require('fs')
const neatCsv = require('neat-csv')

import fs from 'fs';
import neatCsv from 'neat-csv'

fs.readFile('./file.csv', async (err, data) => {
  if (err) {
    console.error(err)
    return
  }
  console.log(await neatCsv(data))
})

Writing JSON

fs.writeFileSync('mahFile.json', JSON.stringify(student));