adventofcode/2021/yarn_boilerplate/main.ts
2023-11-30 22:36:04 +01:00

17 lines
363 B
TypeScript

import { readFileSync } from "fs"
import { argv, exit } from "process"
function main(): void {
console.log(JSON.stringify(argv))
if (argv[2] && argv[2] != "") {
const values = readFileSync(argv[2], "utf8")
const inputs = values.replace('\n', '').split(',')
console.log(JSON.stringify(inputs))
} else {
console.log("No filename")
exit()
}
}
main()