How to use a GitHub repository as a dependency in Node.js

Sometimes you need a dependency that is not published as a regular package at npmjs.com. Probably is the case of a private package. Node.js allows remote dependencies such as GitHub private repository, so let explain how to do that.