codekingpro/portable-devtools
114k
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 connect to the `/-/whoami` registry endpoint to find the username associated with the token, and print to standard output.
20
21If logged into a registry that uses Basic Auth, then simply print the `username` portion of the authentication string.
22
23### Configuration
24
25#### `registry`
26
27* Default: "https://registry.npmjs.org/"
28* Type: URL
29
30The base URL of the npm registry.
31
32
33
34### See Also
35
36* [npm config](/commands/npm-config)
37* [npmrc](/configuring-npm/npmrc)
38* [npm adduser](/commands/npm-adduser)
39 