npm-whoami

显示 npm 用户名

选择命令行版本:

概要

🌐 Synopsis

npm whoami

注意:此命令不支持工作区。

🌐 Note: This command is unaware of workspaces.

描述

🌐 Description

显示当前登录用户的 npm 用户名。

🌐 Display the npm username of the currently logged-in user.

如果登录到提供基于令牌身份验证的注册表,则连接到 /-/whoami 注册表端点以查找与该令牌关联的用户名,并将其打印到标准输出。

🌐 If logged into a registry that provides token-based authentication, then connect to the /-/whoami registry endpoint to find the username associated with the token, and print to standard output.

如果已登录使用基本身份验证的注册表,则只需打印身份验证字符串中的 username 部分。

🌐 If logged into a registry that uses Basic Auth, then simply print the username portion of the authentication string.

配置

🌐 Configuration

registry

  • 默认: "https://registry.npmjs.org/"
  • 类型:网址

npm 注册表的基本 URL。

🌐 The base URL of the npm registry.

也可以看看

🌐 See Also