How to create Node.js modules in C++

As you should know, Node.js is a layer over V8, enterely written in C, Node.js gives you a simple API to V8 functions and lets you call them from Javascript with ease, but, what happen if you need more efficiency?
Well, as you are working with an abstraction layer, you, theorically can create a module in C with a public interface and grab it from that layer, in a way you could interact with the module itself, right?

Yes, you can, this is known as node bindings.

Continue reading “How to create Node.js modules in C++”

Multi-Platform JavaScript Modules

A multi-platform module/library is a piece of code that works shameless in browser, server -usually nodeJS- and embedded systems.
Haven’t you noticed that JQuery works when you import the library from “script” tags in a website and when you “require” it in nodeJS? this is because JQuery controls the global scope and, depending on it, initialises the suit in different manners.

JQuery is the paradigm of multi-platform libraries, it runs in modern and old browsers, from phones to smartwatches, in Webkit, blink or Node, but, how do it do it?

Continue reading “Multi-Platform JavaScript Modules”