remote repository for shell.js
in shell.js run:
repo add https://cdn.jsdelivr.net/gh/levitaes/shell.js-pkgs/functionsthen you can use repo to install packages from this repository
repo install <package>-
Create a new file in the
functionsfolder with nameyourNewFunction.function.js -
Add the following code to the file
export default {
name: "function name",
description: "function description",
execute: async (os, args) => {
// Your code here
},
};- Add the function to
functions/functionList.js
import yourNewFunction from "./functions/yourNewFunction.function.js";and add it to the array
const list = {
// ...
yourNewFunction,
};In the execute function you can use the os and args parameters.
Through the os parameter you have access to the following functions:
os.ask- wait for user inputos.say- print text to useros.next- last message to end function
The args parameter is an array of arguments passed to the function.