3 Modules
Innovation Inc edited this page 2020-12-16 14:31:19 -06:00

Modules

NOTE: Modules will be getting depreciated and replaced soon, despite not even being finished, due to the massive security issues they impose and better alternatives.


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

Removing Modules

This command will remove modules. However, it hasn't been implemented yet.


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.