From da89c1439c9ec3e8811e795742535e4169cb8178 Mon Sep 17 00:00:00 2001 From: Jixun Wu <5713045+jixunmoe@users.noreply.github.com> Date: Sun, 19 Dec 2021 19:30:58 +0000 Subject: [PATCH] Updated Home (markdown) --- Home.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Home.md b/Home.md index f6da854..79d3633 100644 --- a/Home.md +++ b/Home.md @@ -4,8 +4,17 @@ ## 安装 -1. ~~设定 [`.npmrc`][npmrc],加入 `@unlock-music:registry=https://npm.pkg.github.com`~~ GitHub 的需要登入… -2. 安装依赖 `npm i --save @unlock-music/joox-crypto`; +1. 建立一个只有 `package:read` 权限的 PAT Token: +2. 设定 [`~/.npmrc`][npmrc],加入下述内容并替换 `<刚申请的 PAT>` 为刚申请的 Token 值(如 `ghp_ABCDEF0123456789`): + + ```ini + //npm.pkg.github.com/:_authToken=<刚申请的 PAT> + @unlock-music:registry=https://npm.pkg.github.com + ``` + +3. 安装依赖 `npm i --save @unlock-music/joox-crypto`; + +注:使用 GitHub Actions 构建时应该[不需要提供 auth token][ref_workflow]。 ## 使用 @@ -25,3 +34,4 @@ const decrypted = decryptor.decryptFile(data); [npmrc]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package [ref_source]: https://github.com/unlock-music/joox-crypto/blob/main/joox-decrypt +[ref_workflow]: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#installing-a-package-using-an-action \ No newline at end of file