Did you know you can use NPM to manage packages that are not published to the npm directory? I didn't until today! Here is how it's done.
npm i <git-host>:<git-user>/<repo-name>#<branch-name>
For example, you can install the master branch of Laravel Mix:
npm i github:JeffreyWay/laravel-mix#master --save-dev
Some Use Cases
- You want to install a package version that has not been updated on npm.
- You are developing your own npm package and want to test it before publishing.
- You want to manage private dependencies that you'll never publish to the directory.
- Easily testing new or unreleased beta versions.
- You need to be running npm 1.1.65 or higher
- You need to have git installed on your machine.
- This works for github only.
- The github repository must have a valid package.json file.