Module Commands
Creating Modules
module init
Creates a new module.
ajs module init <path>
Shortcuts:
ajs m init
ajs m i
What it does:
Walks you through setting up a new module using templates. The wizard helps you pick the right options so your module follows best practices.
Arguments:
Argument | Description | Required |
---|---|---|
<path> | Where to create it | Yes |
Options:
Option | Description | Default | Shortcut |
---|---|---|---|
--git | Where to get templates from | https://github.com/antelopejs/interfaces.git | -g |
Example:
ajs module init my-module
Managing Imports
These commands help you work with interfaces that your module uses from other modules.
module imports add
Add interfaces to your module.
ajs module imports add <interfaces...>
Shortcuts:
ajs m imports add
ajs m i add
What it does:
Gets the interfaces you need and adds them to your module.
Arguments:
Argument | Description | Required |
---|---|---|
<interfaces...> | Interfaces to add (list them) | Yes |
Options:
Option | Description | Default | Shortcut |
---|---|---|---|
--git | Where to get interfaces from | https://github.com/antelopejs/interfaces.git | -g |
--module | Which module to modify | Current directory | -m |
--optional | Make imports optional | false | -o |
Example:
ajs module imports add database@1 api@2
module imports remove
Take out interfaces you don't need anymore.
ajs module imports remove <interfaces...>
Shortcuts:
ajs m imports remove
ajs m i remove
What it does:
Removes interfaces from your module and cleans up related files.
Arguments:
Argument | Description | Required |
---|---|---|
<interfaces...> | Interfaces to remove (list them) | Yes |
Options:
Option | Description | Default | Shortcut |
---|---|---|---|
--module | Which module to modify | Current directory | -m |
Example:
ajs module imports remove database@1
module imports update
Update all your imported interfaces.
ajs module imports update
Shortcuts:
ajs m imports update
ajs m i update
What it does:
Gets the latest version of all interfaces your module is using.
Options:
Option | Description | Default | Shortcut |
---|---|---|---|
--module | Which module to update | Current directory | -m |
Example:
ajs module imports update
Managing Exports
These commands help you set up the interfaces your module offers to others.
module exports set
Tell Antelopejs where your module's interfaces are.
ajs module exports set <path>
Shortcuts:
ajs m exports set
ajs m e set
What it does:
Sets which folder contains the interfaces your module shares with others.
Arguments:
Argument | Description | Required |
---|---|---|
<path> | Where your interfaces are located | Yes |
Options:
Option | Description | Default | Shortcut |
---|---|---|---|
--module | Which module to modify | Current directory | -m |
Example:
ajs module exports set src/interfaces