ElixirScript

Translates Elixir into JavaScript.

All compile functions return a list of transpiled javascript code or a tuple consisting of the file name for the code and the transpiled javascript code.

All compile functions also take an optional opts parameter that controls transpiler output.

Available options are:

  • :include_path - a boolean controlling whether to return just the JavaScript code or a tuple of the file name and the JavaScript code

  • :root - a binary path prepended to the path of the standard lib imports if needed
  • :env - a Macro.env struct to use. This is most useful when using macros. Make sure that the given env has the macros required. Defaults to ENV.

Summary

Compiles the given Elixir code string

Compiles the elixir files found at the given path

Compiles the given Elixir code in quoted form

Copies the javascript that makes up the ElixirScript standard libs to the specified location

Functions

compile(elixir_code, opts \\ [])

Specs

compile(binary, Dict.t) :: [binary | {binary, binary}]

Compiles the given Elixir code string

compile_path(path, opts \\ [])

Specs

compile_path(binary, Dict.t) :: [binary | {binary, binary}]

Compiles the elixir files found at the given path

compile_quoted(quoted, opts \\ [])

Specs

compile_quoted(Macro.t, Dict.t) :: [binary | {binary, binary}]

Compiles the given Elixir code in quoted form

copy_standard_libs_to_destination(destination)

Copies the javascript that makes up the ElixirScript standard libs to the specified location

make_defmodule(ast)