Volt.JS.Runtime (Volt v0.10.1)

Copy Markdown View Source

Runs JavaScript build tools through QuickBEAM with package dependencies isolated from the user's application.

Summary

Types

t()

@type t() :: %Volt.JS.Runtime{
  entry: String.t() | nil,
  install_dir: String.t(),
  name: GenServer.name() | nil,
  node_modules: String.t(),
  packages: map(),
  pid: pid()
}

Functions

call(runtime, function, args \\ [], opts \\ [])

@spec call(t() | GenServer.server(), String.t(), list(), keyword()) ::
  QuickBEAM.js_result()

child_spec(opts)

@spec child_spec(keyword()) :: Supervisor.child_spec()

ensure!(opts)

@spec ensure!(keyword()) :: t()

node_modules!(runtime)

@spec node_modules!(t()) :: String.t()

package_path!(runtime, package)

@spec package_path!(t(), String.t()) :: String.t()

start(opts)

@spec start(keyword()) :: {:ok, t()} | {:error, Volt.JS.Runtime.Error.t()}

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

stop(runtime)

@spec stop(t() | GenServer.server()) :: :ok