52

GitHub - d-band/better-xlsx: A better xlsx library.

 6 years ago
source link: https://github.com/d-band/better-xlsx
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

better-xlsx

A better xlsx lib for read / write / toTable / from Table

NPM version NPM downloads Build Status Coverage Status Dependency Status Greenkeeper badge


Install

$ npm install better-xlsx

Usage

const fs = require('fs');
const xlsx = require('better-xlsx');

const file = new xlsx.File();

const sheet = file.addSheet('Sheet1');
const row = sheet.addRow();
const cell = row.addCell();

cell.value = 'I am a cell!';
cell.hMerge = 2;
cell.vMerge = 1;

const style = new xlsx.Style();

style.fill.patternType = 'solid';
style.fill.fgColor = '00FF0000';
style.fill.bgColor = 'FF000000';
style.align.h = 'center';
style.align.v = 'center';

cell.style = style;

file
  .saveAs()
  .pipe(fs.createWriteStream('test.xlsx'))
  .on('finish', () => console.log('Done.'));

Todo

  • xlsx parser
  • read excel file
  • write excel file
  • transform html table to excel file html2xlsx

Report a issue

Reference

License

better-xlsx is available under the terms of the MIT License.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK