1.0.0 • Published 1 year ago

@zenmrp/fortune-sheet-excel v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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")).LuckyExcel.transformExcelToLucky(f)).toJsonString())
// in dev: console.log((await (await import("./dist/main.js")).LuckyExcel.transformExcelToLucky(f)).toJsonString())

Authors and acknowledgment

License

MIT

1.0.0

1 year ago