22

How can I show the most recently published versions of an npm package, including beta/unstable versions?

This question helps identify how you can get the most recent, stable version (does not show beta version), but I would like to see a list of the several most recent versions, including beta versions.

$ npm view webpack versions

  ...
  '0.7.9',
  '0.7.11',
  '0.7.12',
  '0.7.13',
  '0.7.14',
  '0.7.15',
  '0.7.16',
  '0.7.17',
  '0.8.0-beta1',
  '0.8.0-beta2',
  ... 316 more items ]

I would like to show the "tail" of this list, instead of seeing the first several packages that were released. Is this possible?

How can I show a list of the most recently released versions for a particular npm package?

Community
  • 1
  • 1
Himmel
  • 3,629
  • 6
  • 40
  • 77

2 Answers2

29

You can use --json flag to output all the versions in the json format, which is quite human-readable

Denys Mikhalenko
  • 3,966
  • 2
  • 14
  • 18
9

I could not overcome that ...xxx more items] issue until I found this blog post by Will Anderson, who should get credits:

npm view some-package-name@* version

The trick is to have a glob with all available package versions, and then for each one of those show its "latest" (one and only) version.

EDIT

As per comment observation (and original blog post), that does not show pre-release versions. To also get pre-release versions and not incur into ... XX more items ] output, one can run (note plural versions):

npm view some-package-name versions --json

superjos
  • 12,189
  • 6
  • 89
  • 134
  • Great suggestion, but it seems like this still does not show all versions, for example `react@16.0.0-alpha.12` is a version not shown. – user239558 May 04 '17 at 11:13