Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This lib allows you to build and write an Excel file dynamically, it does **not*
### Comparison to similar libraries

Excel-buider-vanilla is at the minimum 6x times smaller than the most popular libraries (we used `Bundlephobia` to compare), excel-builder-vanilla is 22Kb gzip while [XLSX](https://bundlephobia.com/package/xlsx) is 136Kb and [ExcelJS](https://bundlephobia.com/package/exceljs) is 251Kb gzip. The reason as to why it's much smaller is simple and relates to 2 major differences:
- excel-builder-vanilla is ESM and all other libraries are CJS only (CommonJS) increasing their download size
- excel-builder-vanilla is ESM-Only and all other libraries are only offering CJS (CommonJS) increasing their download/install size
- excel-builder-vanilla only offers Excel export (writing) but without any reading capabilities

## Live Demo
Expand All @@ -38,7 +38,7 @@ You can also take a look at the "[Used by](#used-by)" section below to see real
[MIT License](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/LICENSE.md)

## Project History
Excel-Builder-Vanilla is a fork of the popular [excel-builder.js](https://github.com/stephenliberty/excel-builder.js) project (thanks to @stephenliberty for this great library). The main goal of creating this fork was to modernize the project by removing old dependencies that are no longer necessary and also replace `JSZip` by `fflate` which provides an ESM build and is indirectly giving us better Tree Shaking. The other goal was also to provide an ESM build to eventually get away from CommonJS (CJS bundle is still offered but we strongly suggest that you migrate to the ESM approach)
Excel-Builder-Vanilla is a fork of the popular [excel-builder.js](https://github.com/stephenliberty/excel-builder.js) project (thanks to @stephenliberty for this great library). The main goal of creating this fork was to modernize the project by removing old dependencies that are no longer necessary and also replace `JSZip` by `fflate` which provides an ESM build and is indirectly giving us better Tree Shaking. The other goal was also to provide an ESM build

The modernization steps:
- migrate to TypeScript (which is giving us TS Types `d.ts`)
Expand All @@ -64,16 +64,12 @@ npm install excel-builder-vanilla

The project offers 3 different build types, choose the best one depending on your use case
1. **ESM**: to `import from` (_**preferred**_)
2. **CJS**: CommonJS to support old NodeJS `require()` - will probably be dropped in the future
3. **IIFE**: standalone script which provides `ExcelBuilder` on the `window` object
2. **IIFE**: standalone script which provides `ExcelBuilder` on the `window` object

```ts
// ESM (preferred) - npm install
import { createWorksheet } from 'excel-builder-vanilla';

// CJS - npm install
const { createWorksheet } = require('excel-builder-vanilla');

// IIFE - CDN
<script src="https://cdn.jsdelivr.net/npm/excel-builder-vanilla@3.0.1/dist/excel-builder.iife.js"></script>
<script>
Expand All @@ -92,7 +88,7 @@ Please note that since we use `fflate` (which creates and compresses the Excel f

### Used by

This fork was created mostly to support Tree Shaking (ESM), to get away from CJS, to provide TS Types and finally to update all project dependencies. It is used by a few other Open Source libraries that I also maintain and require Excel export:
This fork was created mostly to support Tree Shaking (ESM), to provide TS Types and finally to update all project dependencies. It is used by a few other Open Source libraries that I also maintain and require Excel export:

- [Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid)
- [Aurelia-Slickgrid](https://github.com/ghiscoding/aurelia-slickgrid)
Expand Down Expand Up @@ -137,7 +133,7 @@ Before submitting a PR (pull request), please make sure that you followed these
| Package Name | NPM downloads | Size (gzip) | Changes | Description |
| -------------| ------- | ----------- | ------- | ----------- |
| [excel-builder-vanilla](https://github.com/ghiscoding/excel-builder-vanilla/tree/main/packages/excel-builder-vanilla) | [![NPM downloads](https://img.shields.io/npm/dm/excel-builder-vanilla)](https://npmjs.org/package/excel-builder-vanilla) | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/excel-builder-vanilla?color=success&label=gzip)](https://bundlephobia.com/result?p=excel-builder-vanilla) | [changelog](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla/CHANGELOG.md) | `excel-builder-vanilla` library package |
| [excel-builder-vanilla-types](https://github.com/ghiscoding/excel-builder/tree/main/packages/excel-builder-vanilla-types) | [![NPM downloads](https://img.shields.io/npm/dm/@excel-builder-vanilla/types)](https://npmjs.org/package/@excel-builder-vanilla/types) | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@excel-builder-vanilla/types?color=success&label=gzip)](https://bundlephobia.com/result?p=@excel-builder-vanilla/types) | [changelog](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla-types/CHANGELOG.md) | `excel-builder-vanilla` dts types only package.
| [[excel-builder-vanilla-types](https://github.com/ghiscoding/excel-builder-vanilla/tree/main/packages/excel-builder-vanilla-types) | [![NPM downloads](https://img.shields.io/npm/dm/@excel-builder-vanilla/types)](https://npmjs.org/package/@excel-builder-vanilla/types) | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@excel-builder-vanilla/types?color=success&label=gzip)](https://bundlephobia.com/result?p=@excel-builder-vanilla/types) | [changelog](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla-types/CHANGELOG.md) | `excel-builder-vanilla` dts types only package.

## Sponsors

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"@types/node": "^22.14.1",
"@vitest/coverage-v8": "^3.1.1",
"conventional-changelog-conventionalcommits": "^8.0.0",
"cross-env": "^7.0.3",
"happy-dom": "^17.4.4",
"pnpm": "^9.10.0",
"rimraf": "^6.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/excel-builder-vanilla-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"access": "public"
},
"type": "module",
"main": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/excel-builder-vanilla/copy-types.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ copyfiles([source, destination], { stat: true }, err => {
console.error(err);
} else {
// all good, next step, create JS entry file
writeFileSync(`${destination}/dist/index.mjs`, `'use strict';`);
writeFileSync(`${destination}/dist/index.js`, `'use strict';`);
}
});
12 changes: 0 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.