https://github.com/hazae41/wasm
WebAssembly Binary Format (.wasm) decoder-modifier-encoder for TypeScript
https://github.com/hazae41/wasm
Last synced: 6 months ago
JSON representation
WebAssembly Binary Format (.wasm) decoder-modifier-encoder for TypeScript
- Host: GitHub
- URL: https://github.com/hazae41/wasm
- Owner: hazae41
- License: mit
- Created: 2025-11-18T09:46:45.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-18T09:51:20.000Z (8 months ago)
- Last Synced: 2025-11-18T11:25:50.037Z (8 months ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ccamel - hazae41/wasm - WebAssembly Binary Format (.wasm) decoder-modifier-encoder for TypeScript (TypeScript)
README
# WASM
WebAssembly Binary Format (.wasm) decoder-modifier-encoder for TypeScript
```bash
npm install @hazae41/wasm
```
```bash
deno install jsr:@hazae41/wasm
```
[**📦 NPM**](https://www.npmjs.com/package/@hazae41/wasm) • [**📦 JSR**](https://jsr.io/@hazae41/wasm)
## Features
### Current features
- 100% TypeScript and ESM
- No external dependencies
- Rust-like patterns
- No validation done
- Easily edit .wasm
- Latest specification
## Usage
```tsx
import * as Wasm from "@hazae41/wasm"
import { Readable, Writable } from "@hazae41/binary"
import { readFileSync, writeFileSync } from "node:fs"
const module = Readable.readFromBytesOrThrow(Wasm.Module, readFileSync("./mod.wasm"))
const imports = module.body.sections.find(section => section.kind === Wasm.ImportSection.kind)! as Wasm.ImportSection
console.log(imports) // Show all imports
const start = module.body.sections.find(section => section.kind === Wasm.StartSection.kind)! as Wasm.StartSection
start.funcidx = 3 // Change start function
writeFileSync("./mod.wasm", Writable.writeToBytesOrThrow(module))
```