How to Install a NPM Module from GitHub Branch

By  on  

In my journey to work more quickly with a project containing loads of dependencies, I've come across a few techniques I've not needed to use before. I previously wrote about How to Push to a Git Remote Branch of a Different Name -- this time we'll talk about installing a module from another repository instead of a published version.

To install a module from a GitHub branch instead of a tagged and published NPM module, simply reference the username, repository, and branch name:

"dependencies": {
    "eth-ledger-bridge-keyring": "darkwing/eth-ledger-bridge-keyring#work-in-progress",
}

This pattern is useful for a host of reasons, especially when trying to rapidly develop from local branches. Feel free to leave off the branch name if you just want to use master branch!

Recent Features

Incredible Demos

  • By
    Duplicate the jQuery Homepage Tooltips

    The jQuery homepage has a pretty suave tooltip-like effect as seen below: The amount of jQuery required to duplicate this effect is next to nothing;  in fact, there's more CSS than there is jQuery code!  Let's explore how we can duplicate jQuery's tooltip effect. The HTML The overall...

  • By
    HTML5’s placeholder Attribute

    HTML5 has introduced many features to the browser;  some HTML-based, some in the form of JavaScript APIs, but all of them useful.  One of my favorites if the introduction of the placeholder attribute to INPUT elements.  The placeholder attribute shows text in a field until the...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!