cmdm

1.0.0 • Public • Published
#cmdm cool command manager.

cmdm will allow you to lead commands.

First, connect the module.

const cmdm = require('cmdm');

Next, connect the folder with commands. I created a "cmds" folder in the project folder.

cmdm.setPath(__dirname + '/cmds');

I created the file " calc.js "in the" cmds " folder. P.S. if you need to pass arguments to the command, create the exported function "run". My code is from " calc.js":

module.exports.run = (argument) => {
    console.log(argument / 4);
};

You can now add a command.

cmdm.load('calc', 'public', 'console');
//cmdm.load(command name, type of access, type of command);

You can now create a function to run the command.

const xRun = (name, int) => {
    const cmd = cmdm.get(name);
    if(cmd.access == 'public') {
        if(cmd.type == 'console') {
            cmdm.run(name, int);
        };
    };
};
xRun('calc', 64);

If you did everything correctly then in the console you will get "16".

Discord Server

Package Sidebar

Install

npm i cmdm

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

3.77 kB

Total Files

3

Last publish

Collaborators

  • clint_flames