Skip to content

Instantly share code, notes, and snippets.

@renso3x
Created October 18, 2019 08:10
Show Gist options
  • Save renso3x/8051a7bddcf789dc327e505c72df8945 to your computer and use it in GitHub Desktop.
Save renso3x/8051a7bddcf789dc327e505c72df8945 to your computer and use it in GitHub Desktop.
excel parser
const XLSX = require('xlsx')
const path = require('path')
const fs = require('fs')
const file = path.join(__dirname, '/rental_units.xlsx')
fs.readFile(file, (err, data) => {
var wb = XLSX.readFile(file)
/* generate array of arrays */
data = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]], { header: 1 })
// console.log(data)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment