Updated Home (markdown)

Jixun Wu 2021-12-19 19:30:58 +00:00
parent 923caf2d34
commit da89c1439c

14
Home.md

@ -4,8 +4,17 @@
## 安装 ## 安装
1. ~~设定 [`.npmrc`][npmrc],加入 `@unlock-music:registry=https://npm.pkg.github.com`~~ GitHub 的需要登入… 1. 建立一个只有 `package:read` 权限的 PAT Token
2. 安装依赖 `npm i --save @unlock-music/joox-crypto` 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 [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_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