0.0.4 • Published 1 year ago

unioffice v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Node Unioffice

Edit excel file using unioffice (https://github.com/unidoc/unioffice)

This package contains a very limited set of APIs that can be use for simple read/write excel file.

Usage

Set environment variable to supply LICENSE file to unioffice: UNIOFFICE_LICENSE_PATH

npm install unioffice

Example:

const office = require('unioffice');
let wb = office.spreadsheet.open("./filename.xlsx");
//let wb = office.spreadsheet.new();
let ws = wb.sheet('MOMO');
ws.addRows(10);
ws.cell('A1').setValue(123);
ws.cell('A2').setString("ABC");
wb.close();

APIS

Workbook

  • save(filePath)
  • close()
  • sheet(sheetName)
  • addSheet()

Sheet

  • insertRows(rowNumber, numberOfRows)
  • addRows(numberOfRows)
  • copyRows(source, dest, numberOfRows)
  • recalculateFormulas()
  • maxRowIndex(): 1-based index
  • maxColumnIndex(): 0-based index.
  • cell(cellReference)

Cell

  • setValue(val)
  • setNumber(val)
  • setString(val)
  • setDate(val)
  • getValue()
  • getNumber()
  • getString()
  • getDate()
0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago