My first npm module

Finally, I found the time to update the Greek in Tech site and create my very first npm package! The idea was to extract all the entries from the backbone single page application, create a very simple API for all these data / entries and distribute them as an npm package. That way, I could easily use it as a dependency to the SPA site, with all the benefits of an npm module like reusability, easier maintenance, single responsibility etc.

You can still contribute entries on the package’s official repository learn more about it from its official npm page (yes the package’s name is still greek-in-tech). Feel free to use it on your own projects and star it if you like it!

Extending Class methods with Module Mixins

I’m about to finish the Eloquent Ruby book (excellent book by the way) and keep finding ruby pearls of wisdom. One of these is that you can actually use module mixins to extend class methods! You only need to declare a module mixin as normal, and then include it on the singleton class of your declared class (“Klass” in our example).

Then we can use it just like any other class method.