npm profile 全方位解讀

本文參考了NPM中文文檔寫做而成的html

npm profile 功能

更改註冊表配置文件上的設置node

npm profile 使用

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

npm profile 說明

在註冊表上更改您的配置文件信息。若是您使用的是非 npmjs 註冊表,則此功能不可用。git

npm profile get [<property>]:顯示我的資料的全部屬性,或一個或多個特定屬性。看起來像:github

+-----------------+---------------------------+
| name            | example                   |
+-----------------+---------------------------+
| email           | me@example.com (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>:設置配置文件屬性的值。您能夠經過如下方式設置如下屬性:電子郵件,全名,主頁,freenode,twitter,github
  • npm profile set password: 更改您的密碼。這是交互式的,系統將提示您輸入當前密碼和新密碼。若是啓用了雙重身份驗證,系統也會提示您輸入 OTP。
  • npm profile enable-2fa [auth-and-writes|auth-only]:啓用雙重身份驗證。默認爲 auth-and-writesmode。模式有:npm

    • auth-only:登陸或更改賬戶的身份驗證時要求輸入 OTP。網站和命令行上都將須要 OTP。
    • auth-and-writes:始終須要 OTP 進行 auth-only,而且在發佈模塊,設置 latestdist-tag 或經過 npm access 和更改訪問時也須要一個 OTP npm owner。
  • npm profile disable-2fa:禁用兩因素身份驗證。

詳細說明

全部 npm profile 子命令都會接受--json--parseable 會根據這些命令調整其輸出。json

其中一些命令可能在非 npmjs.com 註冊表上不可用。api

本文參考NPM中文文檔網站

相關文章
相關標籤/搜索