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

Youimmi/coffee_compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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