Skip to content

Instantly share code, notes, and snippets.

View notmean11's full-sized avatar
🫠

Jirateep Loyma notmean11

🫠
View GitHub Profile
const args = process.argv.slice(2);
function getArg(flag: string, fallback: string): string {
const i = args.indexOf(flag);
return (i !== -1 && args[i + 1]) ? args[i + 1]! : fallback;
}
const FILE_PATH = getArg("--file-path", "message_service_db.messages.json");
const SAMPLE_SIZE = parseInt(getArg("--sample-size", "10"), 10);