2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-whoami
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: Display npm username
|
|
|
|
---
|
|
|
|
|
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
```bash
|
2022-02-24 21:41:49 +00:00
|
|
|
npm whoami
|
2019-11-05 14:55:08 -05:00
|
|
|
```
|
|
|
|
|
2021-03-23 14:58:11 -04:00
|
|
|
Note: This command is unaware of workspaces.
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Description
|
|
|
|
|
2021-05-20 15:54:50 -04:00
|
|
|
Display the npm username of the currently logged-in user.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
If logged into a registry that uses Basic Auth, then simply print the
|
|
|
|
`username` portion of the authentication string.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
#### `registry`
|
|
|
|
|
|
|
|
* Default: "https://registry.npmjs.org/"
|
|
|
|
* Type: URL
|
|
|
|
|
|
|
|
The base URL of the npm registry.
|
|
|
|
|
2023-06-08 05:24:49 -07:00
|
|
|
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See Also
|
|
|
|
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm config](/commands/npm-config)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npmrc](/configuring-npm/npmrc)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm adduser](/commands/npm-adduser)
|