@nyar/pe-assembler-wasm32
v0.0.0
Published
Assembler for Portable Executable (*.exe,*.dll)
Downloads
8
Maintainers
Readme
PE WebAssembly Library
WebAssembly bindings for the PE (Portable Executable) assembler, providing JavaScript/TypeScript interfaces for browser and Node.js environments.
Overview
This package provides WebAssembly bindings for the PE assembler, enabling:
- Browser Usage: Run PE assembly operations directly in web browsers
- Node.js Support: Use PE assembler in server-side JavaScript applications
- TypeScript Support: Full TypeScript definitions for type safety
- Modern Tooling: Vitest for testing, Vite for bundling
Installation
# Install from the workspace
pnpm install
# Or install directly (if published)
npm install pe-wasm32Usage
JavaScript/TypeScript
import { reader, writer } from './dist/pe_assembler.js';
// Read PE data
const result = reader.read(inputData);
// Write PE data
const output = writer.write(assemblyData);Browser Usage
<script type="module">
import { reader, writer } from './dist/pe_assembler.js';
// Use reader and writer interfaces
const peData = reader.read(fileBuffer);
</script>API Reference
Reader Interface
read(data: Uint8Array): PEStructure- Parse PE file datareadFile(filePath: string): Promise<PEStructure>- Read PE file from path
Writer Interface
write(data: AssemblyData): Uint8Array- Generate PE file from assemblywriteFile(filePath: string, data: AssemblyData): Promise<void>- Write PE file to path
Development
Building
# Build WebAssembly
pnpm build:wasm
# Transpile JavaScript
pnpm transpile:debug
# Build for release
pnpm build:releaseTesting
# Run tests
pnpm test:run
# Run tests with UI
pnpm test:ui
# Run tests with coverage
pnpm test:coverageProject Structure
src/- Source code and WebAssembly bindingsdist/- Built artifacts (JavaScript, TypeScript definitions, WASM)tests/- Test files using Vitestvitest.config.ts- Test configuration
Integration
This package integrates with:
- pe-rust: Core Rust library providing the WebAssembly functionality
- Modern Web Tooling: Works with Vite, Webpack, and other bundlers
- Testing Frameworks: Compatible with Vitest, Jest, and other test runners
License
See the root License.md for details.
