Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get versions from npm registry api

I'm looking for a way to query npm package versions from the npm registry api. All I found until now is that I need to query the whole package metadata and filter the versions from there, Example: https://registry.npmjs.org/react-chuck/

It's ok for package with small amount of versions but for large amount of versions it's just too much time to query.

I thought that maybe there is something like the dist-tags api that query only the dist-tags, Example: https://registry.npmjs.org/-/package/react-chuck/dist-tags , the dist-tags are in the same scope as versions... enter image description here

I don't mind to do it cli also npm view react-chuck versions but this returns array as a string and array of strings.

I looked at those two links:

  • https://github.com/npm/npm-registry-client
  • https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md

Anyone has a tip of champs maybe?

like image 524
yershalom Avatar asked Jan 10 '18 05:01

yershalom


1 Answers

npm show react-chunk time --json
like image 63
jbachman Avatar answered Oct 01 '22 12:10

jbachman