npm-profile

更改 registry 的设置信息

概要

npm profile get [--json|--parseable] [<property>]
npm profile set [--json|--parseable] <property> <value>
npm profile set password
npm profile enable-2fa [auth-and-writes|auth-only]
npm profile disable-2fa

描述

在registry中更改您的配置文件信息。如果您使用的是非npmjs的 registry,则不可用。

  • npm profile get [< property >]:显示您的个人资料的所有属性或一个或多个特定的属性。看起来像:
+-----------------+---------------------------+
| name            | example                   |
+-----------------+---------------------------+
| email           | [email protected] (verified) |
+-----------------+---------------------------+
| two factor auth | auth-and-writes           |
+-----------------+---------------------------+
| fullname        | Example User              |
+-----------------+---------------------------+
| homepage        |                           |
+-----------------+---------------------------+
| freenode        |                           |
+-----------------+---------------------------+
| twitter         |                           |
+-----------------+---------------------------+
| github          |                           |
+-----------------+---------------------------+
| created         | 2015-02-26T01:38:35.892Z  |
+-----------------+---------------------------+
| updated         | 2017-10-02T21:29:45.922Z  |
+-----------------+---------------------------+
  • npm profile set < property > < value >:设置配置文件属性的值。您可以通过以下方式设置以下属性:email, fullname, homepage, freenode, twitter, github
> npm profile set fullname xiaoxiaoxiao
  • npm profile set password: 更改您的密码。这是交互式的,你会被提示输入你当前的密码和一个新的密码。如果启用了双重身份验证,则还会提示您进行OTP。

  • npm profile enable-2fa [auth-and-writes|auth-only]:启用双重身份验证。默认为auth-and-writes模式。模式是:

    • auth-only:登录或更改帐户的身份验证时需要OTP。
    • auth-and-writes:在该模式下不仅auth-only的操作会触发OTP验证,而且npm publish、dist-tag、npm access、npm owner等操作都会触发OTP验证。
  • npm profile disable-2fa:禁用双重身份验证。

配置

json
  • Type:Boolean
  • Default:false

信息以json格式展示。

> npm profile get --json
parseable
  • Type:Boolean
  • Default:false

信息以简单明了格式展示。

results matching ""

    No results matching ""