https://github.com/litejs/xlsx
Create XLSX files in Browser or Server
https://github.com/litejs/xlsx
Last synced: 2 months ago
JSON representation
Create XLSX files in Browser or Server
- Host: GitHub
- URL: https://github.com/litejs/xlsx
- Owner: litejs
- Created: 2025-10-01T14:30:08.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2026-04-14T11:02:20.000Z (2 months ago)
- Last Synced: 2026-04-14T12:24:59.358Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 90.8 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[1]: https://badgen.net/coveralls/c/github/litejs/xlsx
[2]: https://coveralls.io/r/litejs/xlsx
[3]: https://badgen.net/packagephobia/install/@litejs/xlsx
[4]: https://packagephobia.now.sh/result?p=@litejs/xlsx
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro
LiteJS Xlsx – [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
===========
Lightweight (<10KB) XLSX file creator for Browser and Node.js.
Why?
Sometimes you just want to add `Download as Excel` button next to `Download as csv`.
Sometimes you just want to send a simple xlsx with email without adding 30MB of packages.
Examples
--------
```javascript
const { createXlsx } = require("@litejs/xlsx");
const fileAsUint8Array = await createXlsx({
styles: {
My1: {
font: { sz: 15, name: "Calibri" },
fill: "FFFF00",
},
},
sheets: [
{
name: 'Products',
freeze: { rows: 1, cols: 0 },
cols: '20,10,10', // Simple column widths
data: [
['Apple', 1.99, 10],
['Banana', 0.99, 15],
['Orange', 2.49, 8],
['Totals', '=SUM(B1:B3)', {style: 'bold', value: '=SUM(C1:C3)'}]
]
},
{
name: 'Types',
cols: '20,40',
data: [
['true', true],
['false', false],
['Default Date', new Date(1514900750001)],
['Datetime', { format: 'datetime', value: new Date(1514900750001) }],
['Date', { format: 'date', value: new Date(1514900750001) }],
]
},
{
name: 'Styles',
data: [
[{ style: 'My1', value: 'Cell with custom stype'}, 1],
{ height: 25, data: ['Row with custom height', 2] },
]
},
]
})
```
## Contributing
Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
run tests `npm install; npm test`.
> Copyright (c) 2025-2026 Lauri Rooden <lauri@rooden.ee>
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/xlsx) |
[npm package](https://npmjs.org/package/@litejs/xlsx) |
[Buy Me A Tea][6]