简体   繁体   English

如何在正式添加到 npm 或 yarn 之前导入 typescript 模块

[英]How to import a typescript module before it is officially added to npm or yarn

I am new to typescript as well as js.我是打字稿和 js 的新手。 trying to import a module that is being developed, so not yet added to npm.尝试导入正在开发的模块,因此尚未添加到 npm。

how do import it to my code?如何将其导入我的代码?

this is the repo: adding via yarn doesnt work, how or where do i place this code to be able to import into my code?这是回购:通过纱线添加不起作用,我如何或在哪里放置此代码以便能够导入我的代码?

https://github.com/xchainjs/xchainjs-lib/tree/549-add-xchainjs-swap-package/packages/xchain-midgard https://github.com/xchainjs/xchainjs-lib/tree/549-add-xchainjs-swap-package/packages/xchain-midgard

"dependencies" : {
  "name1" : "git://github.com/user/project.git#commit-ish",
  "name2" : "git://github.com/user/project.git#commit-ish"
}

Try this.尝试这个。

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

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