fix: output all the required parameters for npm token list (#9588)
### What Added missing token metadata to `npm token list` outputs: * Added `id` field to the `--json` output. * Added `name` field to the default and `--parseable` outputs of `npm token list`. ### Why Currently, token information is fragmented across different output formats: * `npm token revoke` requires a token ID or token value, but the `--json` output does not expose the token ID. * The default and `--parseable` outputs expose the ID but not the token name. * This makes it difficult to automate token lifecycle management (such as identifying and revoking expired tokens) because users need information from multiple output formats. ### How * Updated the token listing implementation to include the token `id` in the JSON response. * Updated the default and parseable formatters to include the token `name`. * Ensured all output formats expose the metadata required for scripting, automation, and token revocation workflows while maintaining backward compatibility where possible. Fixes the issue: https://github.com/npm/cli/issues/9443
R
rijildaniel committed
6da65552c8941d051340359174d75f54b70dadec
Parent: fdcfcee
Committed by GitHub <noreply@github.com>
on 6/29/2026, 2:54:47 PM