Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the information time object output by npm view should sorted b… #7807

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

btea
Copy link
Contributor

@btea btea commented Oct 2, 2024

…y version

When I execute npm view --json in my local project, the output is as follows:

before after
image image

References

@btea btea requested a review from a team as a code owner October 2, 2024 09:52
lib/commands/view.js Outdated Show resolved Hide resolved
@wraithgar
Copy link
Member

wraithgar commented Oct 2, 2024

I'm not so sure about this, --json is for computer parsing, not human reading. We do sort the results in what's called the prettyView.

I do have a PR underway to sort the tags by publish date, and to truncate them, so that the pretty view is more useful at a glance. It will be part of npm 11.

ETA: I guess we already sort the versions in this display, so the cat's out of the bag there. It still seems silly formatting json for human display.

@wraithgar
Copy link
Member

Draft PR for the pretty view change #7808

@ljharb
Copy link
Contributor

ljharb commented Oct 3, 2024

It does also potentially help programmatic use cases, the majority of which might want them in semver order anyways.

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.

3 participants