diff --git a/Modules.md b/Modules.md new file mode 100644 index 0000000..d9bbeec --- /dev/null +++ b/Modules.md @@ -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. +*** \ No newline at end of file