Registry / web-framework / osiris-educational-transpiler

osiris-educational-transpiler

JSON →
library1.0.28jsnpmunverified

Osiris is an educational transpiler that converts Python and Logo code to JavaScript for browser execution, targeting learners of programming language transpilation. Current version 1.0.28 (stable, low release cadence). Key differentiators: supports Python and Logo, provides a sandboxed execution environment using Web Workers, and includes a built-in execution timeout to prevent infinite loops. Compared to alternatives like Skulpt or Pyodide, Osiris is simpler and focuses on the transpilation learning process rather than full language compatibility.

npm install osiris-educational-transpiler
INSTALL
IMPORT
SIG · OSIRIS-EDUCATIONAL
O
osiris-educational-transpiler
web-frameworkjavascriptv1.0.28
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.

Osiris
import {Osiris} from 'osiris-educational-transpiler'
const Osiris = require('osiris-educational-transpiler')
Package provides ESM module only; CommonJS require will fail.
OsirisPython
import OsirisPython from 'osiris-educational-transpiler/Python'
import {OsirisPython} from 'osiris-educational-transpiler'
OsirisPython is a default export from the /Python entry point, not a named export from main.
OsirisLogo
import OsirisLogo from 'osiris-educational-transpiler/logo'
import OsirisLogo from 'osiris-educational-transpiler/Logo'
Path is case-sensitive; use lowercase 'logo'.

Transpile and execute a simple Python print statement using OsirisPython with event handler for output.

import OsirisPython from 'osiris-educational-transpiler/Python'; const transpiler = new OsirisPython(); transpiler.setEventHandler((event) => { if (event.type === 'output') { console.log(event.output); } }); const result = transpiler.sendCode('print("Hello, World!")'); if (result.success) { transpiler.runCode(); } else { console.error(result.errors); }
osiris --version
Debug
Known issues
gotchasendCode only transpiles; you must call runCode() separately to execute.
fix
Ensure you call runCode() after a successful sendCode().
affects: >=1.0.0
gotchaLogo canvas requires a canvas element with specified ID before runCode().
fix
Create a canvas element with id matching the configured canvasId, e.g., '<canvas id="myCanvas"></canvas>'.
affects: >=1.0.0
gotchaPackage only works in browser environment due to Web Worker usage for Logo and Python execution.
fix
Use Osiris only in browser-based projects; it will fail in Node.js.
affects: >=1.0.0
gotchaImport paths are case-sensitive; using wrong case leads to module resolution failure.
fix
Use exactly 'osiris-educational-transpiler/Python' and 'osiris-educational-transpiler/logo'.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'osiris-educational-transpiler' or its corresponding type declarations.
Missing or incorrect import path.
fix
Use one of: 'osiris-educational-transpiler', 'osiris-educational-transpiler/Python', or 'osiris-educational-transpiler/logo'.
TypeError: transpiler.sendCode is not a function
Using wrong class (e.g., Osiris instead of OsirisPython) or missing import.
fix
Import the correct class: import OsirisPython from 'osiris-educational-transpiler/Python'.
Uncaught ReferenceError: OsirisPython is not defined
Using CommonJS require instead of ES module import.
fix
Use ES module syntax: import OsirisPython from 'osiris-educational-transpiler/Python'.
Error: No canvas element with id 'myCanvas' found.
Canvas element with configured ID not present in DOM.
fix
Add a canvas element with id matching the configuration before calling runCode().
Upgrade
Version history
1.0.28latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
osiris-educational-transpiler — npm install osiris-educational-transpiler · libregistry