Files

20 lines
469 B
JavaScript
Raw Permalink Normal View History

2023-02-26 15:16:21 -05:00
/**
2023-02-26 17:59:11 -05:00
* @returns { Promise<JSON>>}
2023-02-26 15:16:21 -05:00
*/
export function getAndParse() {
return new Promise((resolve) => {
const argsRaw = [...process.argv].slice(2);
const args = {};
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);
});
}