Skip to content

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

Open
yetanotheraryan wants to merge 1 commit intonpm:latestfrom
yetanotheraryan:npm-view-docs
Open

docs: npm view with json outputs array docs updation#9335
yetanotheraryan wants to merge 1 commit intonpm: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)

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.

1 participant