All Projects → Mogztter → opal-node-compiler

Mogztter / opal-node-compiler

Licence: MIT license
Opal Compiler for Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to opal-node-compiler

opal-rspec
Opal + RSpec = ♥️
Stars: ✭ 57 (+280%)
Mutual labels:  opal
opal-haml
Opal + Haml = <3
Stars: ✭ 20 (+33.33%)
Mutual labels:  opal
glimmer-dsl-opal
Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps)
Stars: ✭ 22 (+46.67%)
Mutual labels:  opal
Opal
Ruby ♥︎ JavaScript
Stars: ✭ 4,552 (+30246.67%)
Mutual labels:  opal
sedcli
sedcli and libsed library for NVMe Self-Encrypting Drives (SEDs) management
Stars: ✭ 22 (+46.67%)
Mutual labels:  opal
opal
Policy and data administration, distribution, and real-time updates on top of Open Policy Agent
Stars: ✭ 459 (+2960%)
Mutual labels:  opal
op-test
Testing Firmware for OpenPOWER systems
Stars: ✭ 30 (+100%)
Mutual labels:  opal
negasonic
This ain't Sonic Pi, but it works on the browser: www.negasonic.org
Stars: ✭ 73 (+386.67%)
Mutual labels:  opal
snabberb
A simple component view framework for Ruby Opal based on Snabbdom
Stars: ✭ 41 (+173.33%)
Mutual labels:  opal
vue.rb
Ruby bindings for Vue.js
Stars: ✭ 26 (+73.33%)
Mutual labels:  opal

Opal Compiler for Node.js

Build npm version

Transpile Ruby code to JavaScript in JavaScript!

Usage

Given a Ruby file named hello.rb:

puts "Hello world"

The following code will transpile hello.rb to JavaScript:

const Builder = require('opal-compiler').Builder
// Opal object will be available on the global scope

const builder = Builder.create()
const result = builder.build('hello.rb').toString()
console.log(result)
//(function(Opal) {
//  var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice;

//  Opal.add_stubs(['$puts']);
//  return self.$puts("Hello world")
//})(Opal);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].