loading...
markdown guide
 

As for the downloads, I think there's already npm local cache handling this.

And I am not sure if I understand correctly what you want to achieve, but you can create and intermediate dependency that would aggregate common libraries and then use its build output in your other projects. Maybe it would be a good use case to define the "vendor.js/css" files.

Something like Specific project -> Common Module -> [vendor1, vendor2,...]

 

The short answer is that there is no way to handle similar dependencies over multiple projects. Nor should there be. NPM is designed to be a project package manager. Not a system package manager.

Out of curiosity, what is the drive to combine similar project dependencies?

 

Thank you for your answer. I fully understand that a project is designed to contain all its dependencies in npm and should do so in production state. However, I would like to be able to do this in a local environment.

The drive is simply for disk space and install speed.
I have a small SSD that I use for development mainly because I am on a budget but want speed. Logically it seems unnecessary to have multiple copies of dependencies on the same machine to run a npm package, and I was thinking maybe there is a solution to easily cache common dependencies in a system wide cache folder.

Classic DEV Post from Sep 17 '19

SOLID PRINCIPLES: To start with Object-oriented programming

Damien Golding profile image

Great software developers built here

Sign up 🦄