11cb0ef41Sopenharmony_ci--- 21cb0ef41Sopenharmony_cititle: npm-whoami 31cb0ef41Sopenharmony_cisection: 1 41cb0ef41Sopenharmony_cidescription: Display npm username 51cb0ef41Sopenharmony_ci--- 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci### Synopsis 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci```bash 101cb0ef41Sopenharmony_cinpm whoami 111cb0ef41Sopenharmony_ci``` 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ciNote: This command is unaware of workspaces. 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci### Description 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciDisplay the npm username of the currently logged-in user. 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciIf logged into a registry that provides token-based authentication, then 201cb0ef41Sopenharmony_ciconnect to the `/-/whoami` registry endpoint to find the username 211cb0ef41Sopenharmony_ciassociated with the token, and print to standard output. 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ciIf logged into a registry that uses Basic Auth, then simply print the 241cb0ef41Sopenharmony_ci`username` portion of the authentication string. 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ci### Configuration 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci#### `registry` 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ci* Default: "https://registry.npmjs.org/" 311cb0ef41Sopenharmony_ci* Type: URL 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ciThe base URL of the npm registry. 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ci 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci### See Also 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci* [npm config](/commands/npm-config) 401cb0ef41Sopenharmony_ci* [npmrc](/configuring-npm/npmrc) 411cb0ef41Sopenharmony_ci* [npm adduser](/commands/npm-adduser) 42