# nmm

Nelson Modules Manager.

## Syntax

* st = nmm('list')
* nmm('load', module\_name)
* l = nmm('autoload', module\_name)
* nmm('autoload', module\_name, state)
* nmm('install', git\_url)
* nmm('uninstall', module\_name)
* package\_filename = nmm('package', module\_name, destination\_dir)

## Input argument

* module\_name - a string: short module's name.
* state - a logical: true will autoload module at startup, false disable autoload for this module.
* git\_url - a string: a git url (http/https protocol).
* destination\_dir - a string: an existing destination directory where archive will be created.

## Output argument

* st - a struct: list of installed modules.
* l - a logical: current state of autoload.
* package\_filename - a string: filename.

## Description

nmm is the Nelson Modules Manager.

Source-based distribution packages allows to have optimized packages for your computer and allows to have distributed repositories.

Installed modules are locally built and can require an C/C++.

st = nmm('list') get list of installed modules.

nmm('install', git\_url) install a distant module.

About git\_url, in this example 'https://github.com/nelson-lang/module\_skeleton\_basic.git#v1.0.0'

'#v1.0.0' is defined as #\<commit-ish>, it allows to clone exactly an commit.

The commit-ish can be a tag (exact version), and an sha1 (exac commit) or an branch name.

Without commit-ish, master branch will be used.

nmm('install', filename\_nmz) install an prebuilt external module.

nmm('load', module\_name) load an installed module for current session.

l = nmm('autoload', module\_name returns current state autoload for module\_name.

nmm('autoload', module\_name, state) marks an installed modules "marked" as autoload at startup.

By default modules are marked as autoload.

nmm('uninstall', module\_name) uninstall an installed module.

nmm('package', module\_name, destination\_dir) packages an module as a zip file.

## Examples

Deploy module\_skeleton\_basic template

```matlab
if ~ismodule('module_skeleton_basic')
    nmm('install', 'https://github.com/nelson-lang/module_skeleton_basic.git#v1.0.0');
    macro_sum(3, 4)
    nmm('uninstall', 'module_skeleton_basic')
end
```

Package easily a module

```matlab
if ~ismodule('module_skeleton_basic')
    nmm('install', 'https://github.com/nelson-lang/module_skeleton_basic.git#v1.0.0');
end
package_filename = nmm('package', 'module_skeleton_basic', tempdir())
```

## See also

[ismodule](broken-reference), [getmodules](getmodules).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
