Today, I will show you how to install any Node.js package using its GitHub URL.
If you want the latest release of the package, execute the command below in your command line. In this example, I will be installing the lodash package.
npm install https://github.com/lodash/lodash
If you want to install from a branch, tag, or commit, simply add the branch name, tag name, or commit hash to the URL after a hash symbol.
# Install from a branch(development)
npm install https://github.com/lodash/lodash#development
# Install from a tag name(4.17.15)
npm install https://github.com/lodash/lodash#4.17.15
# Install from a commit
npm install https://github.com/lodash/lodash#8a26eb42adb303f4adc7ef56e300f14c5992aa68
Now you have realized that you can easily install any Node.js package simply by knowing its GitHub URL.