bestikk-opal-compiler
v0.3.1-integration7
Published
A simple tool to compile Ruby code to JavaScript using Opal
Downloads
286
Maintainers
Readme
Bestikk Opal Compiler
ifdef::env-github[] image:http://img.shields.io/travis/bestikk/bestikk-opal-compiler.svg[Travis build status, link=https://travis-ci.org/bestikk/bestikk-opal-compiler] image:http://img.shields.io/npm/v/bestikk-opal-compiler.svg[npm version, link=https://www.npmjs.org/package/bestikk-opal-compiler] endif::[]
A simple tool to compile Ruby code to JavaScript using Opal.
Install
$ npm i --save-dev bestikk-opal-compiler
Usage
var opalCompiler = require('bestikk-opal-compiler');
var compiler = opalCompiler({
dynamicRequireLevel: 'ignore',
defaultPaths: ['special/directory']
});
compiler.compile('hello.rb', 'hello.js'); // <1>
compiler.compile('module/hello', 'module.js', ['extra/directory']); // <2>
<1> Compile Ruby script hello.rb
to hello.js
<2> Compile Ruby module module/hello
to module.js
using an extra directory