npm profile 新功能介绍

转载地址node

npm profile 新功能介绍

npm新版本新推来一个功能,npm profile,这个能够更改本身简介信息的命令,之后能够不用去登陆网站来修改本身的简介了git

具体的这个功能的支持大概是在6这个版本若是你的npm版本没有这个命令的话,建议升级试下github

npm install -g npm

npm profiles主要做用是更改registry profile的设置,刚开始我很蒙圈,不知道啥时profile,直接叫用户信息不就能够了吗?但咱们经过官网的地址登陆后,点击右侧的本身的头像会发现,点击后会出现一个下拉列表,列表里面有个"Profile Settings",因而乎我好像明白了。其实就是更改本身的用户信息而已。能够进入里面看下,基本信息跟咱们稍后列表来profile支持的选项是同样的。npm


npm profile 的简介以下json

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


主要功能也就上面这些,跟我上面的截图的内容差很少一致,之后若是增长了相应的选项的话,应该也会更新对应的配置选项网站

下面详细了解下具体的状况spa

在registry中更改您的我的profile信息。
若是使用的是non-npmjs registry,则没法使用此功能。命令行

npm profile get [<property>]:

展现全部profile中的属性或者一个或者更多的属性,好比个人属性包括以下code

┌─────────────────┬──────────────────────────────────┐
│ name            │ durban                           │
├─────────────────┼──────────────────────────────────┤
│ email           │ zhangdapeng89@126.com (verified) │
├─────────────────┼──────────────────────────────────┤
│ two-factor auth │ disabled                         │
├─────────────────┼──────────────────────────────────┤
│ fullname        │ durban zhang                     │
├─────────────────┼──────────────────────────────────┤
│ homepage        │ www.gowhich.com                  │
├─────────────────┼──────────────────────────────────┤
│ freenode        │                                  │
├─────────────────┼──────────────────────────────────┤
│ twitter         │                                  │
├─────────────────┼──────────────────────────────────┤
│ github          │                                  │
├─────────────────┼──────────────────────────────────┤
│ created         │ 2015-03-18T02:35:58.918Z         │
├─────────────────┼──────────────────────────────────┤
│ updated         │ 2018-07-17T06:27:25.590Z         │
└─────────────────┴──────────────────────────────────┘


这个提示下若是你在运行blog

npm profile

以后没有出现我上面说的状况的话,会有一个问题就是你尚未进行登陆,须要执行

npm login

进行登陆操做

npm profile set <property> <value>: 

设置profile中属性的值,能够设置的属性包括下面的几个
email, fullname, homepage, freenode, twitter, github

npm profile set password: 

修改你的密码。这个是一个交互的功能,你将被提示去输入你当前的密码和一个新的密码,若是开启了双重认证[two-factor authentication]的话,还须要输入一个OTP[动态口令]

npm profile enable-2fa [auth-and-writes|auth-only]: 

容许使用双重认证[two-factor authentication],默认是auth-and-writes模式。
模式的话有以下几种

auth-only: 当登陆或者是修改帐户信息是须要OTP[动态口令]。这个OTP[动态口令]在网站和命令行都会被须要的。
auth-and-writes: 在auth-only的全部时间都须要OTP[动态口令],而且在发布模块,设置最新的dist-tag或经过npm access和npm owner更改访问权时也须要一个OTP[动态口令]。

npm profile disable-2fa: 

禁止使用双重认证[two-factor authentication]

全部npm profile子命令都接受--json和--parseable,并将根据这些命令调整其输出。 其中一些命令可能在non-npmjs registry中不可用。

相关文章
相关标签/搜索