Need help with jcoffeescript?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

yeungda
123 Stars 25 Forks Apache License 2.0 39 Commits 9 Opened issues

Description

coffeescript on rhino

Services available

!
?

Need anything else?

Contributors list

# 466,428
JavaScr...
Java
23 commits
# 29,371
React
url-par...
uri
glsl
8 commits
# 255,652
C#
asp-net...
msbuild
F#
7 commits

JCoffeeScript

JCoffeeScript is a java library that compiles CoffeeScript 1.1.

Usage

from the command prompt:

echo "a = 1" | java -jar jcoffeescript-1.1.jar

      (function() {
          var a;
          a = 1;
       })();

Command Line (unix/windows):

java -jar jcoffeescript-1.1.jar < foo.coffee > foo.js

command line options:

--bare - compile the javascript without top-level function safety wrapper.

From java:

String javascript = new org.jcoffeescript.JCoffeeScriptCompiler().compile("a = 1");

From jruby:

if "java" == RUBY_PLATFORM then
   # use jcoffeescript implementation
   require 'java'
   class CoffeeScriptCompiler
        def initialize
            @compiler = org.jcoffeescript.JCoffeeScriptCompiler.new
        end
        def compile(source)
            @compiler.compile(source)
        end
    end
else
    # use shell out to coffee implementation
    require 'open3'
    class CoffeeScriptCompiler
        def compile(source)
            return Open3.popen3('coffee --eval --print') do |stdin, stdout, stderr|
              stdin.puts source
              stdin.close
              stdout.read
            end
        end
    end
end
compiler = CoffeeScriptCompiler.new
compiler.compile('a = 1')

Thanks

Thanks to Jeremy Ashkenas and all contributors to the coffeescript project.
Thanks to Raphael Speyer for helping with the design.
Thanks to Daniel Cassidy for putting a lot of work into the code.
Thanks to PandaWood for maintaining the code.
JCoffeeScript Homepage

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.