How to see package history?

2020-05-19 03:59发布

问题:

How can I see the history of a package in the Npm registry?

In particular, I want to know when https://npmjs.org/package/npm version 1.1.2 was released.

回答1:

You could do npm view npm there are some options you can find at https://docs.npmjs.com/cli/view

e.g. npm view npm@1.1.2 time



回答2:

For those wondering how to view these details online. There is a slightly ugly* way I found to do that. Here's how

  1. Assuming your package name is <packageName> go to https://registry.npmjs.org/<packageName> the JSON here is probably the same thing you get when you run npm view
  2. Do a Ctrl+F(or equivalent) to search for "time":{ or "<your_version_number>"
  3. You can find the version release date under the "time" key.

For example if you want to find out when version 1.1.25 (couldn't find 1.1.2) of npm was released. You can go to https://registry.npmjs.org/npm Search for "1.1.25" and iterate till you find a value under the "time" key or search for "time":{ (whichever is easier) and there you have it!

"time":{"modified":"2017-10-13T18:58:10.523Z","created":"2013-07-12T18:32:48.902Z","1.1.25":"2013-07-12T18:32:49.875Z"...

*Ugly because you have to parse the JSON to understand the mess :)



回答3:

For some specific versions I have found that time is not present and therefore the package is not listed when running that command. To see a list of all available times for a package run this command: npm view <package> time. To see all versions and history run npm view <package> versions.



标签: node.js npm