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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sync-npm-mirror

v1.0.0

Published

自动同步npm淘宝镜像站上面的包

Downloads

155

Readme

sync-npm-mirror

当你将自己开发的 npm 包发布到 npm 官方仓库时,想要立即同步淘宝镜像站上面的版本,那么就可以使用这个工具自动完成同步工作。

本项目受魔法哥的启发,但是关于实现方式我有自己的想法。 另外,我平时也会发布一些 npm 包,所以这个工具对我来说是一个刚需,于是就有了本项目。

demo

asciicast

安装

npm

npm install -D sync-npm-mirror

yarn

yarn add -D sync-npm-mirror

pnpm

pnpm add -D sync-npm-mirror

使用

with scripts (推荐)

在你需要同步的 npm 包的package.json中添加下面这个脚本:

{
  "name": "awesome-tools",
  "scripts": {
+    "postpublish": "sync-npm-mirror awesome-tools"
  },
  "devDependencies": {
    "sync-npm-mirror": "x.y.z"
  },
}

这样,当你的包在发布到官方仓库之后,会立即执行sync-npm-mirror awesome-tools将这个包同步更新到淘宝镜像站。

⚠️⚠️⚠️ 注意

上面的代码段中的awesome-tools为演示目的,需要替换成你自己的包名。

with require

const { syncNpmMirrorPackage } = require("sync-npm-mirror")

// sync single package
syncNpmMirrorPackage("axios")

// sync multi pakcage
syncNpmMirrorPackage(["axios", "express"])

with cli(global,需要全局安装)

sync-npm-mirror axios

支持同时更新多个包

sync-npm-mirror axios express koa

额外说明

由于依赖中的脚本无法获取到使用它的包名,所以需要在参数中手动指定你要同步的包名,也就是在postpublish脚本中指定包名作为sync-npm-mirror命令的参数。

参考上面的推荐用法。