• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ipfs-shipyard/ipfs-npm-republish: Republish your node project's dependencies ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ipfs-shipyard/ipfs-npm-republish

开源软件地址:

https://github.com/ipfs-shipyard/ipfs-npm-republish

开源编程语言:

JavaScript 100.0%

开源软件介绍:

ipfs-npm-republish

Republish your node project's dependencies to IPFS as a micro-registry

Install

npm install -g ipfs-npm-republish

You also need IPFS running, I recommend installing IPFS Desktop.

Usage

To republish all the dependencies for your application, run the following command within folder with a package-lock.json present:

ipfs-npm-republish

To republish a specific module from npm along with it's dependencies to ipfs, run the following command passing the name of the package:

ipfs-npm-republish react

adding a version string also works:

ipfs-npm-republish [email protected]

You can also publish a new package directly to IPFS without needing to first publish to npmjs.org, run the following command within folder with a package.json present:

ipfs-npm-republish publish

To publish a second release to an existing package that was published to IPFS, you can pass the hash of the previous version of the registry:

ipfs-npm-republish publish bafybeiahqsziz6mxofxlvx3baqcrihjicxoh27mcg4eukwybvb2u7whuzm

You can also merge two micro-registries together:

ipfs-npm-republish merge bafybeib7yv2z6bgmzphqjuexdb6smfah6pitmah4hzqb7rw7yjzmwocb6e bafybeic3ldukh6jfg2wq4fhrigtvgnf5lml6wo5qdkmsdlr3ieo63qczyu

How it works

1. List dependencies for current directory from package-lock.json
2. Calculate list of packages to be republished
3. create an folder to act as ROOT
4. For each package
  1. Fetch packuments for each package and write to ROOT
  2. For each depended upon version:
    1. download the tarball to ROOT
    2. ipfs add tarball
    3. rewrite the dist.tarball url to a local gateway url with tarball hash
5. ipfs add -r ROOT
7. set per-project npm config to use new micro-registry
8. output command to update registry to point to ipfs ROOT hash

TODOS

  • Publish ROOT to ipns (optional due to speed issues)
  • Don't upload private modules
  • support git dependencies
  • check that IPFS is running locally
  • check that you have a package-lock.json
  • tests!

License

MIT




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ChainShot/IPFS-Upload发布时间:2022-06-23
下一篇:
binstd/IPFS: IPFS中文文档发布时间:2022-06-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap