@zenmrp/fortune-sheet-excel
v1.0.3
Published
An Excel-to-FortuneSheet import library
Downloads
57
Readme
FortuneSheetExcel
FortuneSheetExcel is an Excel import library for FortuneSheet. It only supports .xlsx format files (not .xls).
It is a FortuneSheet port of Luckyexcel.
Features
Supports the following spreadsheet features:
- Cell style
- Cell border
- Cell format, such as number format, date, percentage, etc.
- Formula
Usage
import { transformExcelToFortune } from 'FortuneSheetExcel';
// e.g. got a file input change event
const xls = await e.target.files[0].arrayBuffer()
const fsh = await transformExcelToFortune(xls)
setData(fsh.sheets) // use this as the Workbook data
Interactively in a node repl:
f = await (await import("node:fs/promises")).readFile('/home/val/Downloads/Silkscreen.xlsx')
console.log((await (await import("FortuneSheetExcel")).FortuneExcel.transformExcelToFortune(f)).toJsonString())
// in dev: console.log((await (await import("./dist/main.js")).FortuneExcel.transformExcelToFortune(f)).toJsonString())