https://github.com/d-band/better-xlsx
A better xlsx library.
https://github.com/d-band/better-xlsx
excel excel-export excelgenerator nodejs xlsx xlsx-lib xml
Last synced: about 1 year ago
JSON representation
A better xlsx library.
- Host: GitHub
- URL: https://github.com/d-band/better-xlsx
- Owner: d-band
- Created: 2016-11-10T10:22:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T01:53:45.000Z (almost 5 years ago)
- Last Synced: 2024-05-22T11:39:25.286Z (about 2 years ago)
- Topics: excel, excel-export, excelgenerator, nodejs, xlsx, xlsx-lib, xml
- Language: JavaScript
- Homepage: https://d-band.github.io/better-xlsx/
- Size: 1.66 MB
- Stars: 420
- Watchers: 17
- Forks: 36
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
better-xlsx
===========
> A better xlsx lib for read / write / toTable / from Table
[](https://www.npmjs.com/package/better-xlsx)
[](https://www.npmjs.com/package/better-xlsx)
[](https://travis-ci.org/d-band/better-xlsx)
[](https://coveralls.io/github/d-band/better-xlsx?branch=master)
[](https://david-dm.org/d-band/better-xlsx)
[](https://greenkeeper.io/)
[](#backers)
[](#sponsors)
---
## Install
```bash
$ npm install better-xlsx
```
## Usage
- [More Examples](examples)
```javascript
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
- [x] write excel file
- [x] transform html table to excel file [html2xlsx](https://github.com/d-band/html2xlsx)
## Report a issue
* [All issues](https://github.com/d-band/better-xlsx/issues)
* [New issue](https://github.com/d-band/better-xlsx/issues/new)
## Reference
- http://www.ecma-international.org/publications/standards/Ecma-376.htm
- https://github.com/tealeg/xlsx
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].

## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/better-xlsx#backer)]
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/better-xlsx#sponsor)]
## License
better-xlsx is available under the terms of the MIT License.