Over the past few weeks I have really started to enjoy Node.js.

For those unfamilar, Node.js provides

an asynchronous event driven JavaScript runtime…to build scalable network applications.

What I have really loved while dipping my toe into the water is the simplicity of simple publishing Node.js modules (or packages). To begin learning about Node.js, I decided to write a simple wallpaper changer. This was my reddit-node-wallpaper application. The goal was to create a simple application to:

  1. Pull posts from reddit,
  2. Filter by a given criteria,
  3. Grab the image URL from a random filtered post,
  4. Download the image, and
  5. Set the image as the desktop wallpaper.

But if we think about the single responsibility principle, this application does way more than one thing. Working on a new project (use Lorem Picsum to provide the image), I broke the functionality into multiple modules.

  1. Pull an image from the given URL into memory (image-download),
  2. Download the image on to the file system,
  3. Set the image as a wallpaper,
  4. Orchestrate all the functionality (lorem-picsum-wallpaper – also does the previous 2 functions…), and
  5. Expose a CLI (lorem-picsum-wallpaper-cli).

This journey to release my first Node.js few modules was an extremely enjoyable experience. I cannot wait to take on larger projects in the future.

For those wanting to get into Node.js, here are a few resources I used: