You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-43Lines changed: 39 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,51 @@ This lib allows you to build and write an Excel file dynamically, it does **not*
20
20
21
21
### Comparison to similar libraries
22
22
23
-
Excel-buider-vanilla is at the minimum 8x times smaller than the most popular libraries (we used `Bundlephobia` to compare), excel-builder-vanilla is 16.5Kb 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 very simple and relates these 2 major differences:
24
-
- excel-builder-vanilla is ESM-Only (tree shakable) and all other libraries are only offering CJS (CommonJS) increasing their download/install size (not tree shakable)
25
-
- excel-builder-vanilla only offers Excel export (writing) but without any reading capabilities
23
+
Excel-buider-vanilla is at the minimum 8x times smaller than the most popular libraries (we used `Bundlephobia` to compare), excel-builder-vanilla is 16.5Kb 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 very simple and relates to these 2 major differences:
24
+
- excel-builder-vanilla is ESM-Only (tree shakable) and all other libraries are just offering CJS (CommonJS) increasing their download/install size (not tree shakable)
25
+
- excel-builder-vanilla only offers Excel export (writer) but without any reading capabilities
26
26
27
27
## Live Demo
28
28
29
29
Visit the [**Live demo**](https://ghiscoding.github.io/excel-builder-vanilla/) to get started and see all available options and methods that the library offers (all the demos are WYSIWYG (what you is what you'll get, UI vs Export)).<br>
30
30
You can also take a look at the "[Used by](#used-by)" section below to see real world applications taking advantage of this library.
const worksheet =ExcelBuilder.createWorksheet(); // or window.ExcelBuilder.createWorksheet();
56
+
</script>
57
+
```
58
+
59
+
### CSP (Content Security Policy)
60
+
Please note that since we use `fflate` (which creates and compresses the Excel file before sending it to the browser), you might get some CSP errors because of its use of Web Workers. For that reason, you might need to adjust your CSP rules by adding `worker-src 'self' blob:;`
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
61
89
@@ -73,38 +101,6 @@ The project now requires only 1 small dependency which is [fflate](https://githu
73
101
74
102
This modernization is providing a huge decrease in the final build size, with only 1 dependency, and also offers better performance 🚀
75
103
76
-
## Installation
77
-
78
-
[](https:///pr.new/ghiscoding/excel-builder-vanilla)
79
-
80
-
```sh
81
-
npm install excel-builder-vanilla
82
-
```
83
-
84
-
The project offers 3 different build types, choose the best one depending on your use case
85
-
1.**ESM**: to `import from` (_**preferred**_)
86
-
2.**IIFE**: standalone script which provides `ExcelBuilder` on the `window` object
const worksheet =ExcelBuilder.createWorksheet(); // or window.ExcelBuilder.createWorksheet();
96
-
</script>
97
-
```
98
-
99
-
### CSP (Content Security Policy)
100
-
Please note that since we use `fflate` (which creates and compresses the Excel file before sending it to the browser), you might get some CSP errors because of its use of Web Workers. For that reason, you might need to adjust your CSP rules by adding `worker-src 'self' blob:;`
101
-
102
-
```html
103
-
<metahttp-equiv="Content-Security-Policy"
104
-
content="default-src 'self';
105
-
worker-src 'self' blob:;" />
106
-
```
107
-
108
104
### Used by
109
105
110
106
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:
0 commit comments