npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

multi-registry-publish

v0.0.2

Published

同时向多个npm私有镜像发布包

Downloads

1,110

Readme

multi-registry-publish

同时向多个npm镜像站发布npm包

安装

pnpm add multi-registry-publish
npm install multi-registry-publish
yarn install multi-registry-publish

注:安转过程中会生成prepublishOnly、postpublish两个钩子

配置

注:不配置才会走默认配置,以下是默认配置。

在需要发布的npm包的package.json中配置,这次默认配置,不配置

{
  "publishConfig": [
    {
      "registry": "http://localhost:4877"
    },
    {
      "registry": "http://localhost:4878"
    }
  ]
}

默认安装时会触发一次自动注入:

{
  "scripts": {
    "prepublishOnly": "multi-registry-publish",
    "postpublish": "multi-registry-publish"
  }
}

注:这里的scripts脚本key最好不使用hooks钩子(prepublishOnly、publish、postpublish)

已经测过发布时的命令行参数

npm publish --tag beta

会向所有镜像站发布指定dist-tag为beta的包

目前只测试了--tag--verbose能正常被publishConfig里面配置的镜像站共享,其他情况需自行测试

存在的问题

  1. 内部启用了子进程调用了npm publish,这样会存在多次触发publish相关钩子函数。

支持的node版本

目前仅测试了node14+环境下可以进行正常发布。

日志打印

会生成日志文件:/data/logs/error.log、/data/logs/info.log

如何贡献代码

CONTRIBUTING