initial commit

This commit is contained in:
ION606
2023-02-26 15:16:21 -05:00
commit a1db1a1400
10 changed files with 772 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
/**
* @returns { Promise<Array<String>>}
*/
export function getAndParse() {
return new Promise((resolve) => {
const argsRaw = [...process.argv].slice(2);
const args = {};
// const keys = {};
// for (const i of argsRaw) {
// if (i.indexOf('--') !== -1) {
// keys[i.split('--')[1]] = argsRaw.indexOf(i)
// }
// }
const keys = argsRaw.join(" ").split("--");
for (const i of keys) {
if (i.length == 0) continue;
const splitContent = i.split(" ");
args[splitContent[0]] = splitContent.slice(1);
}
return resolve(args);
});
}