cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open btea opened this issue 1 year ago • 3 comments

…y version

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

before after
image image

References

btea avatar Oct 02 '24 09:10 btea

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 avatar Oct 02 '24 16:10 wraithgar

Draft PR for the pretty view change https://github.com/npm/cli/pull/7808

wraithgar avatar Oct 02 '24 16:10 wraithgar

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

ljharb avatar Oct 03 '24 04:10 ljharb