coffee-script

CoffeeScript Compiler
0.4.0 released

Crystal CoffeeScript

GitHub version Build Status

This shard is a Crystal bridge to the official CoffeeScript compiler.

require "coffee-script"

CoffeeScript.compile(File.read("script.coffee")) # => compiled code

The code in this library is a direct port of Ruby's coffee-script gem.

Installation

Add this to your project's shard.yml:

dependencies:
  coffee-script:
    github: jessedoyle/coffee-script
    version: ~> 0.4.0

then execute shards install.

Configuration

You can use an alternate CoffeeScript compiler version by setting the COFFEESCRIPT_SOURCE_PATH environment variable:

export COFFEESCRIPT_SOURCE_PATH=/my/custom/path/coffee-script.js

The compile method also accepts additional arguments that may be passed to the runtime:

src = File.read("script.coffee")

CoffeeScript.compile(src, { bare: true }) # => compiled code

Dependencies

This library depends on the coffee-script-source shard which will be updated anytime a new version of CoffeeScript is released. The coffee-script-source shard's version number will match the corresponding CoffeeScript compiler.

This library uses duktape.cr as the javascript runtime.

License

Distributed under the MIT License. See LICENSE for details.

coffee-script:
  github: jessedoyle/coffee-script
  version: ~> 0.4.0
License MIT
Crystal none

Authors

Dependencies 2

  • coffee-script-source ~> 1.11.1
    {'github' => 'jessedoyle/coffee-script-source', 'version' => '~> 1.11.1'}
  • duktape ~> 0.11.0
    {'github' => 'jessedoyle/duktape.cr', 'version' => '~> 0.11.0'}

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently