Registry / devops / warpo
library3.0.0jsnpmunverified

WARPO is a next-generation AssemblyScript compiler designed to seamlessly migrate TypeScript code to WebAssembly modules. Built as an alternative to the original AssemblyScript compiler, WARPO introduces advanced optimizations and improved developer experience. The current stable version is 3.0.0, released with active development and a focus on performance and compatibility. It leverages Binaryen for WebAssembly optimizations and provides a modern ESM-based API. Key differentiators include better TypeScript integration, enhanced optimization passes, and a streamlined compilation pipeline.

npm install warpo
INSTALL
IMPORT
SIG · WARPO
W
warpo
devopsjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

warpo
import warpo from 'warpo'
const warpo = require('warpo')
Default export is a factory function; ESM-only since v3.0.0.
compile
import { compile } from 'warpo'
import { compile } from 'warpo/src/compile'
Named export for direct compilation; available since v2.0.0.
optimize
import { optimize } from 'warpo'
import optimize from 'warpo/optimize'
Named export; deprecated path 'warpo/optimize' was removed in v3.0.0.
type definitions
import type { CompileOptions } from 'warpo'
import { CompileOptions } from 'warpo'
Type-only import for options interface; use 'import type' to avoid runtime side effects.

Compile a TypeScript source file to WebAssembly using the default compiler factory with optimization enabled.

import warpo from 'warpo'; import { readFileSync, writeFileSync } from 'fs'; const source = readFileSync('example.ts', 'utf-8'); const compiler = warpo(); const result = compiler.compile(source, { optimize: true }); writeFileSync('out.wasm', result.binary); console.log('Compiled successfully!');
Debug
Known issues
breakingVersion 3.0.0 removed CommonJS support; only ESM is supported.
fix
Switch to 'import' syntax or use a transpiler (e.g., esbuild) for CommonJS projects.
affects: >=3.0.0
breakingThe 'optimize' export was renamed from 'optimizeModule' in v2.0.0.
fix
Use 'optimize' instead of 'optimizeModule'.
affects: >=2.0.0 <3.0.0
deprecatedImporting from 'warpo/optimize' is deprecated since v3.0.0.
fix
Import 'optimize' from the main package: 'import { optimize } from 'warpo'.
affects: >=3.0.0
gotchaDefault export is a factory function that must be called to create a compiler instance; direct import is not the compiler itself.
fix
Call warpo() to get a compiler instance before calling compile().
affects: >=1.0.0
gotchaTypeScript types are only available when using 'import type' for interfaces like CompileOptions.
fix
Use 'import type { CompileOptions } from 'warpo' to avoid bundling issues.
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/warpo/index.js not supported.
Trying to use CommonJS require() with an ESM-only package.
fix
Switch to import syntax or set { "type": "module" } in package.json.
TypeError: compiler.compile is not a function
Using the default import as the compiler directly instead of calling the factory function.
fix
const compiler = warpo(); then call compiler.compile().
Cannot find module 'warpo/optimize'
Importing from a deprecated subpath that was removed in v3.0.0.
fix
Import 'optimize' from the main package: 'import { optimize } from 'warpo'.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
binaryenrequiredWebAssembly optimizer used for generating optimized Wasm binaries
Agent activity
10 hits · last 30 days
node
10
Resources
packagewarpo
warpo — npm install warpo · libregistry