Installation
Scramjet is available as an npm package and can be installed using your preferred package manager.Requirements
Before installing Scramjet, make sure you have:- Node.js (recent version recommended)
- A package manager: npm, yarn, or pnpm
Install the package
Package exports
Scramjet provides multiple export options depending on your use case:Default export
Bundled export
Path utilities
Static files
After installation, you need to serve the Scramjet static files from your web server. These files are located in thedist directory of the package:
scramjet.bundle.js- Main Scramjet bundlescramjet.all.js- All-in-one bundle for service workersscramjet.sync.js- Synchronous XHR supportscramjet.wasm.wasm- WebAssembly rewriter module
Make sure these files are accessible from your web server at the paths you configure in your Scramjet initialization.
For development
If you want to build Scramjet from source for development purposes:Install dependencies
Scramjet development requires pnpm. The package includes a preinstall hook to enforce this.
Build the rewriter
rustupwasm-bindgen- Binaryen’s
wasm-opt - The
wasm-snipfork from r58Playz
Run the dev server