Last active
December 2, 2022 10:06
-
-
Save nbogie/7dac3b112f54d04821631eaa233abb6d to your computer and use it in GitHub Desktop.
TypeScript starter function for advent of code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs/promises'; | |
async function readFileAndSolveProblem() { | |
const inputRaw = await fs.readFile("./inputs/inputDay1A.txt", { encoding: 'utf8' }) | |
const inputLines: string[] = inputRaw.split("\n"); | |
console.log({ inputLines }) | |
//TODO: solve the problem here, based on inputLines | |
} | |
readFileAndSolveProblem() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would assume that in your project root directory you have a dir called
inputs
with just the input text in a file calledinputDay1A.txt