https://github.com/neovici/nullxlsx
Minimal JavaScript library to create XLSX spreadsheet and ZIP archive files.
https://github.com/neovici/nullxlsx
Last synced: about 1 year ago
JSON representation
Minimal JavaScript library to create XLSX spreadsheet and ZIP archive files.
- Host: GitHub
- URL: https://github.com/neovici/nullxlsx
- Owner: Neovici
- License: apache-2.0
- Created: 2017-09-02T17:49:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-10T04:26:12.000Z (about 2 years ago)
- Last Synced: 2025-04-12T20:46:26.593Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://www.webcomponents.org/element/Neovici/nullxlsx
- Size: 1.38 MB
- Stars: 6
- Watchers: 4
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
NullXlsx
========
[](https://github.com/Neovici/nullxlsx/actions?workflow=Github+CI)
[](https://codeclimate.com/github/Neovici/nullxlsx/maintainability)
[](https://codeclimate.com/github/Neovici/nullxlsx/test_coverage)
[](https://www.webcomponents.org/element/Neovici/nullxlsx)
[](https://github.com/semantic-release/semantic-release)
Minimal JavaScript library to create XLSX spreadsheet and ZIP archive files.
No dependencies, focused on library size only. Weights 10k minimized, 3k zipped.
### Example usage
```javascript
// Data should be array of arrays
var data = [['Title 1', 'Title 2'],
['Carl', 12.4, new Date(2017, 7 - 1, 10)],
['Mia', 678, new Date()]
];
// Create xlsx
var xlsx = new NullXlsx('test.xlsx')
.addSheetFromData(data, 'Sheet name');
// Generate a link to download the file
document.body.appendChild(xlsx.createDownloadLink('Download test.xlsx'));
```
### Distributables
The "dist" directory has three files:
File | Size (gz) | Description
--- | --- | ---
nullzip.min.js | 4k (1.7k) | ZIP creator only
nullxlsxonly.min.js | 9.9k (3.3k) | XLSX creator only (ZIP parts are there but not exposed)
nullxlsx.min.js | 10k (3.4k) | Both
### Development
Currently this is a node module, only to get closure compiler neatly integrated.
There is a doubt that this works with "require".
Make a clone and then run `yarn` to prepare.
Edit the files in src/.
Compile again by re-running `yarn`.
#### Tests
To run tests locally, run `yarn test`.