📦 Loading from jsDelivr CDN
No npm install required! This example loads the library directly from
jsDelivr.
⚠️ Important: This file must be served via HTTP server (not opened directly as file://).
Run: python -m http.server 8000 in the examples directory, then visit
http://localhost:8000/cdn-example.html
⏳ Initializing WebAssembly module from CDN...
Test Decoder
Select a compressed texture format to test:
💡 How This Works
// Import from jsDelivr CDN
import { initialize, decode_bc1 } from
'https://cdn.jsdelivr.net/npm/texture2ddecoder-wasm@1.2.1/dist/index.mjs';
// Point to WASM files on CDN
await initialize({
wasmPath: 'https://cdn.jsdelivr.net/npm/texture2ddecoder-wasm@1.2.1/wasm'
});
// Now decode!
const decoded = await decode_bc1(data, width, height);
🚀 Benefits
Zero setup: No build tools or npm required
Fast loading: Cached globally by jsDelivr CDN
Version pinning: Use specific versions for stability