Skip to content

litejs/xlsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiteJS Xlsx – Coverage Size Buy Me A Tea

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

const { createXlsx } = require("@litejs/xlsx");
const fileAsUint8Array = await createXlsx({
    sheets: [
        {
            name: 'Products',
            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) }],
            ]
        },
    ]
})

Contributing

Follow Coding Style Guide, run tests npm install; npm test.

Copyright (c) 2025 Lauri Rooden <lauri@rooden.ee>
MIT License | GitHub repo | npm package | Buy Me A Tea

About

Create XLSX files in Browser or Server

Resources

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project