简体   繁体   English

如何在我的 npm 包中包含一个 npm 包

[英]how to Include a npm package in my npm package

我正在创建一个 npm 包,我想要我的 npm 包的date- npm 包如何将此包包含到我的 npm 包中,有什么办法吗?

If you're just building an npm library then just include date lib in your package.json dependencies.如果您只是构建一个 npm 库,那么只需在 package.json 依赖项中包含date lib。 Once a user installs your lib, then npm will take care of the rest.一旦用户安装了您的 lib,npm 将负责其余的工作。

Just execute只需执行

npm install date-npm

in your package.在你的包裹里。

Once your package is published, anyone installing your package, like:一旦你的包被发布,任何人安装你的包,比如:

npm install your-groovy-package-here

will have date-npm , as well as any other dependencies your package might have, installed along with it.将有date-npm ,以及你的包可能有的任何其他依赖项,与它一起安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM