View Source Nodelix (nodelix v1.0.0-alpha.15)
Nodelix is an installer and runner for Node.js.
Warning
This is a pre-release version. As such, anything may change at any time, the public API should not be considered stable, and using a pinned version is recommended.
Nodelix configuration
There is one global configuration for the nodelix application:
:cacerts_path
- the directory to find certificates for https connections
Profiles
You can define multiple nodelix profiles. There is a default empty profile which you can configure its args, current directory and environment:
config :nodelix,
default: [
args: ~w(
some-script.js
--some-option
),
cd: Path.expand("../assets", __DIR__),
],
custom: [
args: ~w(
another-script.js
--another-option
),
cd: Path.expand("../assets/scripts", __DIR__),
env: [
NODE_DEBUG: "*"
]
]
The default current directory is your project's root.
To use a profile other than default
, you can use
the --profile
option:
mix nodelix --profile custom
When mix nodelix
is invoked, the task arguments will
be appended to the ones configured in the profile.
Summary
Functions
Returns the configuration for the given profile.
Installs Node.js if the configured version is not available,
and then runs node
.
Same as install_and_run/3
but using the latest known LTS version at the time of publishing.
Runs the given command with args
.
Same as run/3
but using the latest known LTS version at the time of publishing.
Functions
Returns the configuration for the given profile.
Raises if the profile does not exist.
Installs Node.js if the configured version is not available,
and then runs node
.
Returns the same as run/3
.
Same as install_and_run/3
but using the latest known LTS version at the time of publishing.
Runs the given command with args
.
The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.
Same as run/3
but using the latest known LTS version at the time of publishing.