Skip to content

Commit 1e6c555

Browse files
authored
docs: fix some typos
1 parent 1fdfa9a commit 1e6c555

1 file changed

Lines changed: 39 additions & 43 deletions

File tree

README.md

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,51 @@ This lib allows you to build and write an Excel file dynamically, it does **not*
2020

2121
### Comparison to similar libraries
2222

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
2626

2727
## Live Demo
2828

2929
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>
3030
You can also take a look at the "[Used by](#used-by)" section below to see real world applications taking advantage of this library.
3131

32+
## License
33+
34+
[MIT License](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/LICENSE.md)
35+
36+
## Installation
37+
38+
[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https:///pr.new/ghiscoding/excel-builder-vanilla)
39+
40+
```sh
41+
npm install excel-builder-vanilla
42+
```
43+
44+
The project offers 3 different build types, choose the best one depending on your use case
45+
1. **ESM**: to `import from` (_**preferred**_)
46+
2. **IIFE**: standalone script which provides `ExcelBuilder` on the `window` object
47+
48+
```ts
49+
// ESM (preferred) - npm install
50+
import { createWorksheet } from 'excel-builder-vanilla';
51+
52+
// IIFE - CDN
53+
<script src="https://cdn.jsdelivr.net/npm/excel-builder-vanilla@3.0.1/dist/excel-builder.iife.js"></script>
54+
<script>
55+
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:;`
61+
62+
```html
63+
<meta http-equiv="Content-Security-Policy"
64+
content="default-src 'self';
65+
worker-src 'self' blob:;" />
66+
```
67+
3268
### Basic Usage
3369

3470
```ts
@@ -48,14 +84,6 @@ artistWorkbook.addWorksheet(albumList);
4884
downloadExcelFile(artistWorkbook, 'Artist WB.xlsx');
4985
```
5086

51-
## Changelog
52-
53-
[CHANGELOG](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/packages/excel-builder-vanilla/CHANGELOG.md)
54-
55-
## LICENSE
56-
57-
[MIT License](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/LICENSE.md)
58-
5987
## Project History
6088
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
6189

@@ -73,38 +101,6 @@ The project now requires only 1 small dependency which is [fflate](https://githu
73101

74102
This modernization is providing a huge decrease in the final build size, with only 1 dependency, and also offers better performance 🚀
75103

76-
## Installation
77-
78-
[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](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
87-
88-
```ts
89-
// ESM (preferred) - npm install
90-
import { createWorksheet } from 'excel-builder-vanilla';
91-
92-
// IIFE - CDN
93-
<script src="https://cdn.jsdelivr.net/npm/excel-builder-vanilla@3.0.1/dist/excel-builder.iife.js"></script>
94-
<script>
95-
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-
<meta http-equiv="Content-Security-Policy"
104-
content="default-src 'self';
105-
worker-src 'self' blob:;" />
106-
```
107-
108104
### Used by
109105

110106
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

Comments
 (0)