Wyvern

raw JSON →
0.2.0 verified Fri May 01 auth: no javascript

wyvern is a reactive JavaScript transpiler that compiles reactive syntax into standard JavaScript. At version 0.2.0, it is in early development with an unstable API. It differentiates itself by providing a declarative reactive programming model that compiles to efficient vanilla JS, targeting developers who want reactivity without a runtime library. The package is meant to be used as a build tool (transpiler) and is not designed for runtime use. Release cadence is unknown as the project is new.

error ERR_REQUIRE_ESM
cause Using require() to import an ESM-only package.
fix
Replace require('wyvern') with import statements or use dynamic import.
error TypeError: wyvern.compile is not a function
cause Default import or wrong import path.
fix
Use named import: import { compile } from 'wyvern';
breaking API is unstable and may change without notice in versions < 1.0.0.
fix Pin to exact version and expect breaking changes.
gotcha Package is ESM-only; CommonJS require will fail with ERR_REQUIRE_ESM.
fix Use ES module syntax (import) or dynamic import() in CommonJS projects with bundler.
gotcha compile() options may be incomplete; check documentation for supported options.
fix Supply only sourceType if unsure; options object may be ignored.
npm install wyvern
yarn add wyvern
pnpm add wyvern

Shows how to use the compile function to transpile a source file, with error handling.

import { compile } from 'wyvern';
import { readFileSync, writeFileSync } from 'fs';

const source = readFileSync('input.js', 'utf8');
try {
  const output = compile(source, { sourceType: 'module' });
  writeFileSync('output.js', output.code, 'utf8');
} catch (e) {
  console.error('Compilation failed:', e.message);
}