Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
champkeh committed Jun 5, 2022
1 parent 3b6acdb commit c7ae21a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://github.com/champkeh/sync-npm-mirror/actions/workflows/publish-and-release.yml"><img src="https://github.com/champkeh/sync-npm-mirror/actions/workflows/publish-and-release.yml/badge.svg" alt="workflows status"></a>
</p>

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

> 本项目受[魔法哥](https://github.com/cssmagic/npm-mirror-sync/issues/2)的启发,但是关于实现方式我有自己的想法。<br/>
> 另外,我平时也会发布一些 npm 包,所以这个工具对我来说是一个刚需,于是就有了本项目。
Expand Down Expand Up @@ -39,7 +39,7 @@ pnpm add -D sync-npm-mirror

### with `scripts` (推荐)

Add `postpublish` script in `package.json` as follows:
在你需要同步的 npm 包的`package.json`中添加下面这个脚本:

```diff
{
Expand All @@ -53,6 +53,12 @@ Add `postpublish` script in `package.json` as follows:
}
```

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

> ⚠️⚠️⚠️ 注意
>
> 上面的代码段中的`awesome-tools`为演示目的,需要替换成你自己的包名。
### with `require`

```js
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sync-npm-mirror",
"version": "0.3.6",
"version": "0.3.7",
"license": "MIT",
"author": "champkeh",
"description": "同步npm镜像站上面的包",
Expand Down

0 comments on commit c7ae21a

Please sign in to comment.