Created Modules (markdown)

Innovation Inc 2020-02-26 19:20:04 -06:00
parent 81c4dc78ab
commit f00d63df9a

46
Modules.md Normal file

@ -0,0 +1,46 @@
# Modules
***
## What are modules?
Modules are a way to temporarily add functionality to DremJS. Modules are installed using the `insmod` command on the terminal.
Modules are currently very experimental and not recommended at all. It is also not yet finished, as only one of three planned types of modules are currently implemented. They are also very insecure, so it is recommended to only use on local networks. This is because there is currently very little error detection, and DremJS pretty much just runs whatever is on the loaded file.
***
## Module Types
Currently, there is only one type of module and two more are planned.
### Terminal
Terminal type modules are modules that adds functionality to the terminal with a command. Currently, these modules are not persistent, and closing the terminal will discard these modules.
### Immediate
This type of module executes immediately. Not implemented yet.
### Parentscript
This type of module adds functionality to DremJS's main JavaScript file. Not implimented yet.
***
## Module Installation Scripts
Under construction.
***
## Installing Modules
Currently, you can only install remote files. However, this does not mean that you can't install modules that are on the web server DremJS is on (that's what the `modules` folder is for).
Example:
```
insmod remote http://192.168.x.x/modules/foo-0.0.0.djsm
```
***
## Making a Module
Making a module is easy - its just a few lines before your JavaScript code itself.
### Making a Terminal Module
Terminal modules have two line before your code - one for type identification, and one for the new command name.
Example:
```
type terminal;
name example;
```
### Making an Immediate Module
Under construction.
### Making a Parentscript Module
Under construction.
***