module
for core> module {flags} (module) (block)
module
: module name or module pathblock
: body of the module if 'module' parameter is not a module pathinput | output |
---|---|
nothing | nothing |
Define a custom command in a module and call it
>modulespam { export deffoo [] { "foo" } };usespamfoo;foo
foo
Define an environment variable in a module
>modulefoo { export-env { $env.FOO="BAZ" } };usefoo;$env.FOO
BAZ
Define a custom command that participates in the environment in a module and call it
>modulefoo { export def-envbar [] { $env.FOO_BAR="BAZ" } };usefoobar;bar;$env.FOO_BAR
BAZ
This command is a parser keyword. For details, check: https://www.nushell.sh/book/thinking_in_nu.html
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/module.html