@@ -21,14 +21,14 @@ npm install cel-typescript
2121```
2222
2323** Requirements:**
24+
2425- Node.js 18 or later
2526
2627This package includes pre-compiled native binaries for multiple platforms:
2728
2829- macOS (x64, arm64)
2930- Linux (x64, arm64)
3031- Windows (x64)
31- - Android (arm64, armv7)
3232
3333The appropriate binary for your platform will be automatically loaded at
3434runtime.
@@ -156,6 +156,40 @@ The native module is built using NAPI-RS and provides cross-platform support:
156156- This structure allows for seamless cross-platform distribution while
157157 maintaining platform-specific optimizations
158158
159+ ### Package Size and Platform Support
160+
161+ The npm package is relatively large (~ 37 MB unpacked) because it includes
162+ pre-compiled native binaries for all supported platforms:
163+
164+ - macOS (x64, arm64)
165+ - Linux (x64, arm64)
166+ - Windows (x64)
167+
168+ However, when you install this package, npm will only extract the ` .node ` file
169+ for your platform. For example:
170+
171+ - On an M1/M2 Mac, only ` cel-typescript.darwin-arm64.node ` (~ 7.4 MB) is used
172+ - On Windows, only ` cel-typescript.win32-x64.node ` is used
173+ - On Linux, only ` cel-typescript.linux-x64.node ` or
174+ ` cel-typescript.linux-arm64.node ` is used
175+
176+ This is a common pattern for packages with native bindings. For comparison:
177+
178+ - ` sharp ` (image processing): 39.7 MB unpacked
179+ - ` better-sqlite3 ` : 12.8 MB unpacked
180+ - ` canvas ` : 8.9 MB unpacked
181+
182+ #### A Note on Tree-Shaking
183+
184+ Tree-shaking (dead code elimination) primarily works with JavaScript modules and
185+ doesn't affect native binaries. The ` .node ` files are loaded dynamically at
186+ runtime based on the platform, so tree-shaking can't eliminate unused platform
187+ binaries during build time.
188+
189+ However, the JavaScript/TypeScript portion of this package is tree-shakeable.
190+ For example, if you only use ` evaluate() ` and not ` CelProgram ` , a bundler like
191+ webpack or Rollup can exclude the unused code.
192+
159193### How it Works
160194
161195When you build this project:
0 commit comments