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.
Common errors
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';
Warnings
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.
Install
npm install wyvern yarn add wyvern pnpm add wyvern Imports
- compile wrong
const wyvern = require('wyvern'); const compile = wyvern.compile;correctimport { compile } from 'wyvern'; - default (module) wrong
const wyvern = require('wyvern');correctimport wyvern from 'wyvern'; - transform
import { transform } from 'wyvern';
Quickstart
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);
}