Skip to content

A template repository for solving Advent of Code and experimenting with Bun runtime.

License

Notifications You must be signed in to change notification settings

adrianklimek/advent-of-code-bun

Repository files navigation

Advent of Code with Bun

A template repository for solving Advent of Code and experimenting with Bun runtime.

Getting started

  1. Generate your repository using this template.
  2. Make sure you have installed Bun.
  3. Install dependencies:
bun install
  1. Create .env file based on .env.example.
  2. (Optional) Set your session token with environment variables to automatically fetch your input. You can obtain the session token from the AoC session cookie.

Running the Code

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.

Example usage

To run a solution for the first day:

bun solve 1

To run tests in watch mode:

bun test --watch 

Structure

For each day a directory in src is created with the following structure:

📂 01
├── 📜 01.ts
├── 📜 01.test.ts
├── 📜 example.txt
└── 📜 input.txt

Closing words

Happy coding! 🎄✨

About

A template repository for solving Advent of Code and experimenting with Bun runtime.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published