-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·54 lines (52 loc) · 1.5 KB
/
index.js
File metadata and controls
executable file
·54 lines (52 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env node
const [,, cmd] = process.argv;
switch (cmd) {
case 'help':
import('./cmds/help.js').then((mod) => mod.default?.());
break;
case 'Hello':
import('./cmds/hello.js').then((mod) =>mod.default?.());
break;
case 'ping':
import('./cmds/ping.js').then((module) => {
const args = process.argv.slice(3);
module.default(args);
});
break;
case 'date':
import('./cmds/date.js').then((mod) => mod.default?.());
break;
case 'cal':
import('./cmds/cal.js').then((mod) => mod.default?.());
break;
case 'calc':
import('./cmds/calc.js').then((module) => {
const args = process.argv.slice(3);
module.default(args);
});
break;
case 'reverse':
import('./cmds/reverse.js').then((mod) => mod.default?.(process.argv.slice(3)));
break;
case 'cli-stats':
import('./cmds/cli-stats.js').then((mod) => mod.default?.());
break;
case 'weather':
import('./cmds/weather.js').then((mod) => mod.default?.(process.argv.slice(3)));
break;
case 'random-int':
import('./cmds/random-int.js').then((mod) => mod.default?.(process.argv.slice(3)));
break;
case 'echo':
import('./cmds/echo.js').then((mod) => mod.default?.());
break;
case 'but-better':
import('./cmds/but-better.js').then((mod) => mod.default?.());
break;
case 'support':
import('./cmds/but-better.js').then((mod) => mod.default?.());
break;
default:
console.log(`Unknown command: ${cmd}`);
console.log(`Try: simple help`);
}