A template repository for solving Advent of Code and experimenting with Bun runtime.
- Generate your repository using this template.
- Make sure you have installed Bun.
- Install dependencies:
bun install
- Create
.env
file based on.env.example
. - (Optional) Set your session token with environment variables to automatically fetch your input. You can obtain the session token from the AoC session cookie.
To run any solution you have to run the solve
script. It will create all directories and files for a day, and also it can fetch your input file. Besides that, it watches all the changes you make and shows a result in a terminal.
To run a solution for the first day:
bun solve 1
To run tests in watch mode:
bun test --watch
For each day a directory in src
is created with the following structure:
📂 01
├── 📜 01.ts
├── 📜 01.test.ts
├── 📜 example.txt
└── 📜 input.txt
Happy coding! 🎄✨