elixir_script v0.26.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
  • :core_path - The es6 import path used to import the elixirscript core. When using this option, the Elixir.js file is not exported
  • :full_build - For compile_path, tells the compiler to perform a full build instead of incremental one
  • :output - option to tell compiler how to output data

    • nil: Return as list
    • :stdout: Write to standard out
    • path (string): Write to specified path

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

Returns the contents of the bootrstrap js file

Functions

compile(elixir_code, opts \\ %{})
compile(binary, Map.t) :: [binary | {binary, binary} | :ok]

Compiles the given Elixir code string

compile_path(path, opts \\ %{})
compile_path(binary | [binary] | map, Map.t) :: [binary | {binary, binary} | :ok]

Compiles the elixir files found at the given path

compile_quoted(quoted, opts \\ %{})
compile_quoted(Macro.t, Map.t) :: [binary | {binary, binary} | :ok]

Compiles the given Elixir code in quoted form

get_bootstrap_js(module_format)

Returns the contents of the bootrstrap js file