[NPM] Load package from local

In package management systems like npm (for JavaScript/Node.js projects), dependencies are typically fetched from a remote registry. However, there are times when developers want to depend on a package that is local to their machine or not published to a registry. This is where the file: protocol comes into play in the package.json file.

"dependencies": {
    "@awesome/logger": "file:../logger"
}

It means that the project has a dependency on the @awesome/logger package, but instead of downloading it from a registry (like npm's registry), it's going to source it directly from a local directory.

posted @ 2023-08-16 15:40  Zhentiw  阅读(15)  评论(0)    收藏  举报