@justybase/spreadsheet-tasks 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +36 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -30,6 +30,42 @@ A high-performance TypeScript library for reading and writing Excel files in XLS
30
30
  npm install @justybase/spreadsheet-tasks
31
31
  ```
32
32
 
33
+ ## 🌐 Browser Support & CDN (Zero Dependencies)
34
+
35
+ This library includes browser-compatible modules to generate XLSB and XLSX files directly on the client side without relying on Node.js APIs or external dependencies.
36
+
37
+ To bundle the browser version into a single minified file (e.g. for deployment to a CDN), run the following command in the project root:
38
+
39
+ ```bash
40
+ npx esbuild browser/browser-spreadsheet.js --bundle --minify --format=esm --outfile=browser/justybase-spreadsheet.min.js
41
+ ```
42
+
43
+ You can then import this single file via a script tag in any web application:
44
+
45
+ ```html
46
+ <script type="module">
47
+ import { downloadXlsb, downloadXlsx } from 'https://your-cdn.com/justybase-spreadsheet.min.js';
48
+
49
+ const headers = ["ID", "Name", "Score"];
50
+ const rows = [
51
+ [1, "Alice", 99.5],
52
+ [2, "Bob", 88.0]
53
+ ];
54
+
55
+ // Generates the file and triggers the browser download automatically
56
+ document.getElementById('downloadBtn').addEventListener('click', () => {
57
+ downloadXlsb('report.xlsb', rows, headers, { headerStyle: 'bold+fill' });
58
+ });
59
+ </script>
60
+ ```
61
+
62
+ **Features included in the browser build:**
63
+ - Built-in Zip archiving (no external libraries needed)
64
+ - Memory-efficient `Uint8Array` buffer handling
65
+ - Auto-fitted column widths
66
+ - Frozen and styled headers (styles: `bold`, `fill`, `bold+fill`)
67
+ - Auto-filters enabled by default
68
+
33
69
  ## 🔧 Quick Start
34
70
 
35
71
  ### Writing Excel Files
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justybase/spreadsheet-tasks",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "High-performance TypeScript library for reading and writing Excel files in XLSB and XLSX formats. XLSB is 3.3x faster to write and 2.1x faster to read than XLSX.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",