Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

nodejs json to sheet

import * as xlsx from 'xlsx'

const jsonSheet: {
  City: string
  'No Users': number
}[] = []

const newWB = xlsx.utils.book_new()

const newWs = xlsx.utils.json_to_sheet(jsonSheet)

xlsx.utils.book_append_sheet(newWB, newWs, "Stats")

xlsx.writeFile(newWB, './users-stats.xlsx')
 
PREVIOUS NEXT
Tagged: #nodejs #json #sheet
ADD COMMENT
Topic
Name
3+3 =