{"id":26053,"library":"osiris-educational-transpiler","title":"Osiris Educational Transpiler","description":"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.","status":"active","version":"1.0.28","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install osiris-educational-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add osiris-educational-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add osiris-educational-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package provides ESM module only; CommonJS require will fail.","wrong":"const Osiris = require('osiris-educational-transpiler')","symbol":"Osiris","correct":"import {Osiris} from 'osiris-educational-transpiler'"},{"note":"OsirisPython is a default export from the /Python entry point, not a named export from main.","wrong":"import {OsirisPython} from 'osiris-educational-transpiler'","symbol":"OsirisPython","correct":"import OsirisPython from 'osiris-educational-transpiler/Python'"},{"note":"Path is case-sensitive; use lowercase 'logo'.","wrong":"import OsirisLogo from 'osiris-educational-transpiler/Logo'","symbol":"OsirisLogo","correct":"import OsirisLogo from 'osiris-educational-transpiler/logo'"}],"quickstart":{"code":"import OsirisPython from 'osiris-educational-transpiler/Python';\nconst transpiler = new OsirisPython();\ntranspiler.setEventHandler((event) => {\n  if (event.type === 'output') {\n    console.log(event.output);\n  }\n});\nconst result = transpiler.sendCode('print(\"Hello, World!\")');\nif (result.success) {\n  transpiler.runCode();\n} else {\n  console.error(result.errors);\n}","lang":"javascript","description":"Transpile and execute a simple Python print statement using OsirisPython with event handler for output."},"warnings":[{"fix":"Ensure you call runCode() after a successful sendCode().","message":"sendCode only transpiles; you must call runCode() separately to execute.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Create a canvas element with id matching the configured canvasId, e.g., '<canvas id=\"myCanvas\"></canvas>'.","message":"Logo canvas requires a canvas element with specified ID before runCode().","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Osiris only in browser-based projects; it will fail in Node.js.","message":"Package only works in browser environment due to Web Worker usage for Logo and Python execution.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use exactly 'osiris-educational-transpiler/Python' and 'osiris-educational-transpiler/logo'.","message":"Import paths are case-sensitive; using wrong case leads to module resolution failure.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use one of: 'osiris-educational-transpiler', 'osiris-educational-transpiler/Python', or 'osiris-educational-transpiler/logo'.","cause":"Missing or incorrect import path.","error":"Cannot find module 'osiris-educational-transpiler' or its corresponding type declarations."},{"fix":"Import the correct class: import OsirisPython from 'osiris-educational-transpiler/Python'.","cause":"Using wrong class (e.g., Osiris instead of OsirisPython) or missing import.","error":"TypeError: transpiler.sendCode is not a function"},{"fix":"Use ES module syntax: import OsirisPython from 'osiris-educational-transpiler/Python'.","cause":"Using CommonJS require instead of ES module import.","error":"Uncaught ReferenceError: OsirisPython is not defined"},{"fix":"Add a canvas element with id matching the configuration before calling runCode().","cause":"Canvas element with configured ID not present in DOM.","error":"Error: No canvas element with id 'myCanvas' found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}