nox v0.3.2 Nox.Npm View Source

NPM wrapper

Link to this section Summary

Types

Option values specific to the compile function

Options used by the compile function

Option values used by the install function

Options used by the install function

Functions

Clean up application

Launch npm install if node_modules is stale

Returns full path to npm executable

Launch npm install

Return NODE_PATH for given project

Returns true if installed version matches required one

Returns real version given a dir

Link to this section Types

Link to this type compile_opt() View Source
compile_opt() :: {:force, boolean()}

Option values specific to the compile function

Link to this type compile_opts() View Source
compile_opts() :: [compile_opt() | install_opt()]

Options used by the compile function

Link to this type install_opt() View Source
install_opt() :: {:werror, boolean()}

Option values used by the install function

Link to this type install_opts() View Source
install_opts() :: [install_opt()]

Options used by the install function

Link to this section Functions

Link to this function clean(_, dir) View Source
clean(Nox.Env.t(), Path.t()) :: :ok

Clean up application

Link to this function compile(env, dir, opts \\ []) View Source
compile(Nox.Env.t(), Path.t(), compile_opts()) ::
  {:ok, warnings :: [String.t()] | :uptodate}
  | {:error,
     {code :: number(), warnings :: [String.t()], errors :: [String.t()]}}

Launch npm install if node_modules is stale

Can be forced with force opt

Returns full path to npm executable

Launch npm install

Link to this function install(env, dir, archive, opts) View Source
install(Nox.Env.t(), Path.t(), install_opts() | Path.t(), install_opts()) ::
  {:ok, warnings :: [String.t()]}
  | {:error,
     {code :: number(), warnings :: [String.t()], errors :: [String.t()]}}
Link to this function install_global(env, name, opts \\ []) View Source
install_global(Nox.Env.t(), String.t(), install_opts()) ::
  {:ok, warnings :: [String.t()]}
  | {:error,
     {code :: number(), warnings :: [String.t()], errors :: [String.t()]}}

Install global

Return NODE_PATH for given project

Returns true if installed version matches required one

Link to this function version(dir) View Source
version(Nox.Env.t() | Path.t()) :: String.t() | :error

Returns real version given a dir