forked from sheetjs/sheetjs
SheetJS
cd2e639fc2
- export `sheet_to_txt` (fixes #905 h/t @aj4mq) - BIFF4 Format Record aligned to BIFF 2/3 (fixes #909 h/t @ToujouAya) - updated CFB to 1.0.1 - typescript standalone demo - nexe / pkg xlsx.njs demo
13 lines
402 B
TypeScript
13 lines
402 B
TypeScript
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
/* vim: set ts=2: */
|
|
|
|
import * as XLSX from 'xlsx';
|
|
|
|
const { read, utils: { sheet_to_json } } = XLSX;
|
|
|
|
export function readFirstSheet(data:any, options:XLSX.ParsingOptions): any[][] {
|
|
const wb: XLSX.WorkBook = read(data, options);
|
|
const ws: XLSX.WorkSheet = wb.Sheets[wb.SheetNames[0]];
|
|
return sheet_to_json(ws, {header:1, raw:true});
|
|
};
|