Advent of Code... In JavaScript!
My own solutions for Advent of Code.
Make sure to have Node.js and Git installed.
Clone the repository
git clone https://github.com/wizardassassin/Advent-of-Code.git
cd Advent-of-Code
Install the dependencies
npm i
Running a single solution
The example runs the solution for day 1, year 2022.
node . debug 2022 1
Example output
{
"year": 2022,
"day": 1,
"output": { "PartOne": 73211, "PartTwo": 213958 },
"duration": "0.3455ms"
}
Running all solutions
node . run
The results are aggregated into a json file. The duration is in milliseconds.
node . create 2023 1
Creates the template files for day 1, year 2023.
To delete a day or year, manually remove the respective files and folders, and prune the metadata file.
rm -r year-2023/day-01
rm -d year-2023
node . prune