How to install local npm package in a project

In some cases, like for testing purposes, you might want to use an npm package stored on a local machine. Here is how you can do that with one simple command.
In typical case scenario you pass a published package name when installing it via npm:
npm install jqueryLet's say you have awesome-editor library written by yourself stored on your local machine under ~/projects/awesome-editor.
Installing it in your project is as simple as:
npm install ~/projects/awesome-editorOnce the installation is finished you will see a new entry in package.json:
"awesome-editor": "file:<relative path goes here>",That's it, you can now use it in your project!
Work with a team that keeps learning and building better software every day.
Related posts
Dive deeper into this topic with these related posts
You might also like
Discover more content from this category
In the world of Elixir programming, there are numerous features and syntactic constructs that contribute to the language's elegance and expressiveness. One such hidden gem is the concept of "implicit try".
Warnings in Elixir are usually an important sign of a problem in the codebase. There is an easy way to make them gone.
Did you ever create a commit that you wish never happened? Let's be honest - we all did. There is an easy way to revert it in Git.
