1---
2title: npm-whoami
3section: 1
4description: Display npm username
5---
6
7### Synopsis
8
9```bash
10npm whoami
11```
12
13Note: This command is unaware of workspaces.
14
15### Description
16
17Display the npm username of the currently logged-in user.
18
19If logged into a registry that provides token-based authentication, then
20connect to the `/-/whoami` registry endpoint to find the username
21associated with the token, and print to standard output.
22
23If logged into a registry that uses Basic Auth, then simply print the
24`username` portion of the authentication string.
25
26### Configuration
27
28#### `registry`
29
30* Default: "https://registry.npmjs.org/"
31* Type: URL
32
33The base URL of the npm registry.
34
35
36
37### See Also
38
39* [npm config](/commands/npm-config)
40* [npmrc](/configuring-npm/npmrc)
41* [npm adduser](/commands/npm-adduser)
42