@javelina/npmhelpers 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,7 +39,25 @@ sha256File("some-file.bin"); // 'e3b0c442...'
39
39
 
40
40
  ## 发布
41
41
 
42
- 包名是 scoped 包(`@javelina/npmhelpers`),已在 `package.json` 中配置 `publishConfig.access = "public"`,会作为公开包发布:
42
+ 包名是 scoped 包(`@javelina/npmhelpers`),已在 `package.json` 中配置 `publishConfig.access = "public"`,会作为公开包发布。
43
+
44
+ ### 免浏览器登录(推荐)
45
+
46
+ 使用 npm 的 Access Token 认证,发布时无需打开浏览器登录:
47
+
48
+ 1. 在 [npmjs.com](https://www.npmjs.com/settings/javelina/tokens) 生成一个 **Granular Access Token**(或 Classic Token),权限选择 `@javelina/npmhelpers` 的 **Read and write**。
49
+ 2. 设置环境变量后直接发布:
50
+
51
+ export NPM_TOKEN=npm_xxxxxxxx
52
+ npm publish --//registry.npmjs.org/:_authToken="$NPM_TOKEN"
53
+
54
+ 也可以把它写入 `~/.npmrc`,以后所有 npm 命令都自动认证:
55
+
56
+ //registry.npmjs.org/:_authToken=npm_xxxxxxxx
57
+
58
+ ### 交互式登录
59
+
60
+ 如果暂时没有 token,也可以继续用浏览器登录(每次发布前需登录一次):
43
61
 
44
62
  npm login
45
63
  npm publish
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javelina/npmhelpers",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A small collection of everyday JavaScript helper utilities.",
5
5
  "type": "module",
6
6
  "main": "./index.js",