Humblemug – My first node module

by Patrick Connelly posted on February 14, 2015

I have been working on migrating a site that I designed off of HTML with lots of javascript into a node.js app. The site has very little in the way of user interaction and mainly just displays dynamic data out to the users. This data is pulled from a number of sources but because it’s pulled client-side it’s terrible for SEO (I was young and should have known better).

One of the issues I encountered when migrating this site is that they have a gallery page that pulls data from a SmugMug album. When this site was originally written, SmugMug only had an XML based API and to make it so that JavaScript would play nice, I had to write a php wrapper that would pull down the XML and re-host it on the same domain. I sure as heck wasn’t going to tarnish my pretty little rewrite with PHP. So I tried to find a node module for SmugMug, and much to my surprise, couldn’t. And with that, Humblemug was born.

Humblemug

Humblemug is really quite simple. It makes the http requests and spits out the JSON that the SmugMug 1.3.0 API returns. Where Humblemug got interesting is that it’s my first package published out on npm. I’ve written modules for local apps, so I’m familiar with the structure, but I’ve never had to write something that others could use.

I followed the guide that Brent Ertz published and it went without a hitch. The module is really bare bones right now (I only added the couple of methods I needed) and has no testing (GASP!). I plan on adding testing soon and then adding some more functionality to it soon. Hopefully I figure out how I want to structure everything before I get too far and have to re-do it all.

So, if you have a need for SmugMug integration in node.js feel free to checkout my first module.

Download Humblemug