excel-builder-vanilla
v4.2.1
Published
An easy way of building Excel files with javascript
Maintainers
Readme
Excel-Builder-Vanilla
Documentation
📘 Documentation website powered by GitBook
Live Demo
Available Live demo which displays all available options/methods.
Installation
npm install excel-builder-vanillaThe project offers 2 different bundle types, choose the best for your use case
- ESM: to
import from(preferred) - IIFE: standalone script with
ExcelBuilderavailable on thewindowobject
// ESM - npm install
import { createWorksheet } from 'excel-builder-vanilla';
// IIFE - CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/excel-builder.iife.js"></script>
<script>
const worksheet = ExcelBuilder.createWorksheet();
</script>Basic Usage
import { downloadExcelFile, Workbook } from 'excel-builder-vanilla';
const originalData = [
['Artist', 'Album', 'Price'],
['Buckethead', 'Albino Slug', 8.99],
['Buckethead', 'Electric Tears', 13.99],
['Buckethead', 'Colma', 11.34],
];
const artistWorkbook = new Workbook();
const albumList = artistWorkbook.createWorksheet({ name: 'Artists' });
albumList.setData(originalData);
artistWorkbook.addWorksheet(albumList);
downloadExcelFile(artistWorkbook, 'Artist WB.xlsx');