Oct 28, 2020

Skripts & Files

Files

Files are the fundamental building blocks of every skript within DEX8. Think of a skript as the instruction manual that guides a worker's actions, with each file often equating to a JavaScript function.

The files attached to a skript are specific to that skript and cannot be attached to any other skript. Each skript has its own set of files, and these files cannot be shared with other skripts.

The Files section provides an overview of all active files, allowing users to create new files and manage existing ones. By clicking the 'Edit' button, users can access a built-in JavaScript Editor for file modification.

DEX8 Web Panel - Files List DEX8 Web Panel - Edit File

Skripts

Skripts are comprehensive collections of files, essentially bundles of JavaScript functions that give instructions to the worker.

A skript operates within a NodeJS environment and is required to include a 'main.js' file. A main.js file is required. All other files within a skript are interconnected through the CommonJS module system, 'module.exports' and 'require()'.

In the Skripts section, users can explore a catalog of skript scripts that can be deployed on one or more workers. This section empowers users to create, review, edit, delete, or even purge all skripts on their account.

The 'Edit Skript' page enables users to modify skript details, download the skript for local use, and manage skript files.

New skripts can be created using the 'Add Skript' page, which allows uploading skript files directly from a local computer. Skripts that share a title or category with an existing skript will overwrite the previous version. These skripts must include a 'manifest.json' file to define HTML form fields.

If you have a skript saved in a Git repository, you can easily upload it to the DEX8 database using the DEX8 Panel.

DEX8 Web Panel - Skript List

Delete Skript

There is a Delete button that can be used to delete a skript. When a skript is deleted, all of the files that are associated with the skript are also deleted.

Edit Skript

In the edit skript page, users can change the following fields:

  • Title: The name of the skript
  • Description: A brief description of the skript
  • Thumbnail: A small image that represents the skript
  • Category: The category that the skript belongs to
  • Howto: Instructions on how to use the skript.

Users can add, edit, and delete skript files on the same page. Additionally, they can manage Input and InputSecret files.

Skript Bundle

The Skript is transmitted to the worker in a bundled format, meaning that the main.js and its associated files, included with CommonJS require(), are bundled using webpack. Consequently, the bundled Skript is dispatched to the worker for execution. Therefore, it's crucial to create a bundle each time any of the Skript files is modified.

DEX8 Web Panel - Edit skript DEX8 Web Panel - Edit skript