A minimal and extensible Ruby to JavaScript transpiler that converts Ruby syntax into clean, readable JavaScript.
Ruby2JS is a transpiler that converts Ruby code into modern JavaScript, enabling developers to write frontend logic in Ruby while targeting web browsers and JavaScript runtimes. It provides a bridge between Ruby's expressive syntax and the JavaScript ecosystem, supporting various frameworks and ES specifications.
Ruby developers who want to write frontend code in Ruby for web applications, and teams working with frameworks like Rails, Stimulus, React, or Lit that seek to unify their development language across stack layers.
Developers choose Ruby2JS for its ability to produce clean, readable JavaScript output while maintaining Ruby's syntax and idioms, with extensible filters and support for specific JavaScript versions and framework integrations.
Ruby to JavaScript conversion
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables writing frontend logic in Ruby's clean, readable syntax, which transpiles directly to modern JavaScript as shown in examples like `items.map { |x| x * 2 }` becoming `items.map(x => x * 2)`.
Seamlessly works with Rails, Stimulus, React, and Lit, allowing developers to unify their stack using Ruby, as highlighted in the framework integrations documentation.
Customizable filters transform Ruby methods to JavaScript equivalents, such as converting `.each` to `.forEach`, providing flexibility in code translation.
Supports outputting JavaScript for specific ES versions from 2020 to 2025, ensuring compatibility with modern browser features and runtimes.
The full Opal-based demo is ~5MB, indicating potential performance impacts on web applications due to increased load times and memory usage.
Requires Ruby and gem installation, which can complicate setup in pure JavaScript or Node.js environments and add maintenance burden.
Not all JavaScript libraries or advanced features may have equivalent Ruby representations, potentially restricting access to parts of the JS ecosystem without custom filters.