Skip to content

docs: npm view with json outputs array docs update#9335

Merged
owlstronaut merged 1 commit into
npm:latestfrom
yetanotheraryan:npm-view-docs
May 12, 2026
Merged

docs: npm view with json outputs array docs update#9335
owlstronaut merged 1 commit into
npm:latestfrom
yetanotheraryan:npm-view-docs

Conversation

@yetanotheraryan
Copy link
Copy Markdown
Contributor

The --json flag for npm view now always returns an array, even when only a single version matches. Previously, a single item result would be unwrapped and returned as a plain object/string, which made programmatic parsing fragile - consumers had to handle both array and non-array shapes depending on how many versions matched.

This doc update adds a note to npm-view.md clarifying that the output is always an array when --json is used, reflecting the behavioral fix.

References

Related to npm/statusboard#1074 (comment)

@owlstronaut owlstronaut changed the title docs: npm view with json outputs array docs updation docs: npm view with json outputs array docs update May 12, 2026
@owlstronaut owlstronaut merged commit 6704ab2 into npm:latest May 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants