Amaro is a low-level Node.js wrapper around `@swc/wasm-typescript`, a WebAssembly port of the SWC TypeScript parser. It primarily performs type stripping, which is utilized internally by Node.js for its native TypeScript support. As of its latest stable release, version 1.1.8, Amaro offers a stable API that allows developers to use a specific TypeScript transpiler version independently of the one embedded in Node.js. The package sees frequent updates, often aligning with new SWC versions. Its key differentiators include synchronous type stripping (`transformSync`), flexible loader mechanisms (`amaro/strip`, `amaro/transform`) for direct execution of TypeScript files, and enhanced monorepo development workflows via conditional exports, abstracting away build steps. It currently supports TypeScript version 5.8.
npm install amaroVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates synchronous type stripping using `amaro.transformSync` and provides examples of how to activate Amaro as a Node.js loader for direct TypeScript execution.
Migrate to using Node.js's native `--import` flag with `amaro/strip` or `amaro/transform`, or use the `node:module` `register()` API for programmatic loader registration.
Always include the `--enable-source-maps` flag when running Node.js with `amaro/transform`: `node --enable-source-maps --import="amaro/transform" file.ts`.
Upgrade your Node.js runtime to version 22 or newer to meet the `engines` requirement specified in `package.json`.
Ensure the `--conditions=typescript` flag is passed to Node.js when leveraging TypeScript conditional exports: `node --import="amaro/strip" --conditions=typescript ./src/index.ts`.
For direct CLI usage, switch to `node --import="amaro/strip"`. For programmatic registration, use `import { register } from "node:module"; register("amaro/strip", import.meta.url);`Ensure your project is configured as an ESM module (`"type": "module"` in `package.json`) or that the file using `import` has an `.mjs` extension. If activating the loader via CLI, use the recommended `node --import="amaro/strip"` syntax.
Run Node.js with the `--conditions=typescript` flag: `node --conditions=typescript --import="amaro/strip" your-app.ts`.
Migrate your code to use `import` statements or ensure your files are treated as CommonJS modules by using `.cjs` extensions or omitting `"type": "module"` in `package.json`.
No dependency data recorded yet.