UNPKG

imagination-gen

Version:

<img src="https://salvage.is-inside.me/SWZL7qgA.png" alt="Imagination-Gen" width="250" /><br>

20 lines (19 loc) 410 B
#!/usr/bin/env node let commands = { cmd1: () => { console.log("this is command 1"); }, cmd2: () => { console.log("this is command 2"); }, }; if (process.argv[2]) { if (commands[process.argv[2].toLowerCase()]) { return commands[process.argv[2].toLowerCase()](); } } else { console.log("Commands:"); for (const [key, value] of Object.entries(commands)) { console.log(key); } }