elixir_script v0.14.1 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
  • :stdlib_path - The es6 import path used to import the elixirscript standard lib. When using this option, the elixir.js file is not exported

Summary

Functions

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

Returns the standard lib js code

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

standard_libs()

Returns the standard lib js code