eo2js is a transpiler that converts EOLANG (EO) programs to JavaScript, enabling execution in Node.js and browser environments. Current version 0.0.8 is pre-1.0 with active development. It translates EO objects and contracts into equivalent JS classes and functions, preserving the purely object-oriented paradigm. Unlike general transpilers, it is purpose-built for EO's abstract object model, including attributes, dataization, and runtime type checking. Release cadence is irregular; frequent breaking changes expected. Differentiators: native EO-to-JS mapping, minimal runtime, and support for EO's freeze/lock semantics.
npm install eo2jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This code transpiles a simple EO program to JavaScript and executes it using the eolang runtime.
Update calls to use new parameter order: eo2js(source, options)
import { compile } from 'eo2js' instead of import eo2js from 'eo2js'Ensure eolang package is installed and imported before executing transpiled code
Replace target with platform in options object
Run npm install eo2js and ensure you are using ESM import syntax (not require).
Change to import statement and use .mjs file extension or 'type':'module' in package.json.
Use import { compile } from 'eo2js' or import * as eo2js from 'eo2js' and call eo2js.compile().