Transpile Ruby code to JavaScript in Node.js using the Opal Ruby-to-JS compiler. Current stable version 3.0.0 is based on Opal 1.7.3 and requires Node >=16. Release cadence is irregular. Unlike browser-focused Opal builds, this package provides a Node-native API (Builder) to compile Ruby files programmatically. Key differentiator: direct Node.js integration with no separate runtime required, supporting modern ESM patterns in v3.
npm install opal-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Transpile a Ruby file to JavaScript and print the compiled output.
Upgrade Node.js to >=16.
Use import syntax or enable ESM in your project.
Use the current Builder.create() API as documented.
Simply import the package; Opal is available on window/globalThis.
Install opal as a dependency (npm install opal).
Use Builder.create() static factory method.
Run 'npm install opal-compiler' and ensure import/require path matches.
Import the package at top level (import 'opal-compiler' or require('opal-compiler')) before using Opal.Upgrade Node to >=16.