sheetjs/demos/typescript/lib/index.ts
SheetJS cd2e639fc2 version bump 0.11.11: CFB miscellany
- 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
2017-12-01 00:48:10 -05:00

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});
};