Finding solutions to the 2022 Advent of code and playing around with Deno
The project is set up as a CLI and has a day command that takes a kebab-case string to denote the date:
deno run --allow-read=. main.ts day oneCompile the project with the permissions flags and run the CLI with an executable
deno compile --allow-read=. main.ts
# compilation output ensues
./advnt day oneOh no, how do I get rid of this thing? Just...
rm advntAlternatively, the program can be installed and run with the advnt name
First, we install the package globally and give it permission to read the hd when installing
deno install --allow-read=. main.ts
# ... installation logs to stdout
advnt day oneUninstalling is a breeze
deno uninstall advntLastly, you can use the -p or --part flag to run either part one or two of
the day's solution
advnt day one -p two- Set up tests for each day. Day 1 has a very small, initial one,but the ideal is to have the test file set up with the example given and use the tests for a TDD approach to a solution.
- This project probably needs import maps set up, but still learning the ways of Deno