I finally got around to open sourcing a foundational JavaScript library we’ve been using at GitHub in production since 2013. selector-observer allows you to monitor DOM elements that match a CSS selector. It provides a more robust pattern to initialize scripts on page load or changes.

The modern version is written as an ES module and doesn’t have any framework dependencies. However, I thought it would be fun to dig up the original implementation I wrote back in October of 2013. Back then, most GitHub scripts were written in CoffeeScript and jQuery.