Skip to content

Stuart428/nodeshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Shell To use simply call console_start from console.ts

How do i register commands?

import type { command } from "../../console";
export const echo: command = {
  name: "echo", // this is the name of the command so if i changed this to echo1 i would have to do echo1 "Hello, World"
  run: (params) => {
    // code goes here
    // params is a array of strings so params[0] would be the string in this command: echo "Hello, World!"
    console.log(params[0]);
  },
};

Then in register.ts

import type { command } from "../console";
//command imports (import the var from your file with the command)
import { echo } from "./echo/echo";
import { clear } from "./clear/clear";
// Command list simply add the imported command var to the table
export const commands: command[] = [echo, clear];

About

A console/ shell kind of thing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published