Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Latest commit

 

History

History
38 lines (26 loc) · 1.12 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.12 KB

CoffeeCompiler

CoffeeScript compiler for elixir

CI hex.pm version

Documentation

API documentation is available at https://hexdocs.pm/coffee_compiler/Coffee.html

Installation

Add coffee_compiler to your list of dependencies in mix.exs:

def deps do
  [
    {:coffee_compiler, "~> 0.1"}
  ]
end

Usage

coffee = "/path/to/file.coffee"
Coffee.compile(coffee)
{:ok, "console.log(\"Application\")"}

Coffee.compile(coffee, [root_path: "/absolute/path/to/import/file"})
{:ok, "var o;o=function(o){return`this is Foo file: ${o}`};console.log(o)"}

You should pass an root_path parameter if you use @import derective to include some code Use relavtive paths @import ./relative/path/to/file in .coffee files

License

CoffeeCompiler is released under the MIT License