It's getting to be that time of year when the annual Advent of Code kicks off. I've taken a swing at it the last couple of years but always fell off after a few days. One of the biggest reasons was having to setup a new 'project' every day. Having to take the time to copy things over and tweak the config was often just enough to keep me from keeping on.
So this year I've put together a package to install a starter project with minimal effort and I've made it available to everyone through NPM. Now I'm not going to claim that this is the best in the world. In fact it's still a bit rough.
I'll be dogfooding it for the rest of the month while I work through some of the previous years puzzles. Anything I find that makes getting up and running with the least possible effort will be added to the package.
I'm also hoping that some folks may find it useful enough to make some suggestions to improve it 🙏
The README.md should give a pretty clear idea of how to use the package. Of special note: I've made sure you can run it using the
npx command. For those who might not be familiar,
npx allows you to run an
npm command without actually installing it. It's pretty slick 🙌
For example, you can just run
and the package will work it's magic without any extra work on your part. It really is one of my favorite things about the Node ecosystem!
Sorry to gush 😊
I've also added a flag for all of the options so that you can setup an alias in your terminal's configuration. So rather than typing it all out every day or going through the wizard, you could just setup something like
alias newcli='npx @thedavefulton/create-node-cli ts --name "Dave Fulton" --project '
and then everyday you just type
and you're off 🚀
So you're still not convinced that this is the one thing that could make 2020 not a complete dumpster fire?
Well, you're probably right 😢
But there are a few other things that I think make this pretty useful. I've included a few packages that will make your life a little easier and hopefully help you focus on solving the various daily challenges.
I've also included a basic testing setup using Jest. I really like having this around for AoC. They usually offer a bunch of examples for their problems and writing a couple of simple unit tests using their data can really clarify my thinking 🤔
Prettier is there because I like to not worry about how my code is formatted and styled and whatnot
Chalk is there because I like to worry about how my output is formatted and styled and whatnot.
I'm also keeping an eye on adding utility functions when they seem appropriate. For instance, there's a function now that will read a file and give you back an array of lines. Nothing fancy, but I hate having to write that stuff over and over.
I'd also love you hear your thoughts and suggestions for improving it! I'm sure there are a bunch of things I haven't thought of that could make your life easier. But more importantly: they could also make my life easier 😃
Be well 🖖