Module: RubyES6ModuleTranspiler
- Defined in:
- lib/ruby_es6_module_transpiler.rb
Constant Summary collapse
- Node =
::ExecJS::ExternalRuntime.new( name: 'Node.js (V8)', command: ['nodejs', 'node'], runner_path: File.('../support/es6-node-runner.js', __FILE__), encoding: 'UTF-8' )
Class Attribute Summary collapse
-
.js_code ⇒ Object
Returns the value of attribute js_code.
Class Method Summary collapse
-
.transpile(code, options = {}) ⇒ Object
accepts amd, cjs, yui, or global.
Class Attribute Details
.js_code ⇒ Object
Returns the value of attribute js_code.
8 9 10 |
# File 'lib/ruby_es6_module_transpiler.rb', line 8 def js_code @js_code end |
Class Method Details
.transpile(code, options = {}) ⇒ Object
accepts amd, cjs, yui, or global. defaults to amd.
18 19 20 21 |
# File 'lib/ruby_es6_module_transpiler.rb', line 18 def transpile(code, = {}) @js_code = code Node.exec(generate_source()) end |