node.js 如何查看包历史?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14982502/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to see package history?
提问by Colonel Panic
How can I see the history of a package in the Npm registry?
如何在 Npm 注册表中查看包的历史记录?
In particular, I want to know when https://npmjs.org/package/npmversion 1.1.2 was released.
特别想知道https://npmjs.org/package/npm1.1.2什么时候发布。
回答by pfried
You could do npm view npmthere are some options you can find at https://docs.npmjs.com/cli/view
您可以npm view npm在https://docs.npmjs.com/cli/view找到一些选项
e.g. npm view [email protected] time
例如 npm view [email protected] time
回答by raghav710
For those wondering how to view these details online. There is a slightly ugly* way I found to do that. Here's how
对于那些想知道如何在线查看这些详细信息的人。我发现有一种有点丑陋的方法可以做到这一点。就是这样
- Assuming your package name is
<packageName>go tohttps://registry.npmjs.org/<packageName>the JSON here is probably the same thing you get when you runnpm view - Do a Ctrl+F(or equivalent) to search for
"time":{or"<your_version_number>" - You can find the version release date under the "time" key.
- 假设您的包名称
<packageName>转到https://registry.npmjs.org/<packageName>JSON,这可能与您运行时得到的相同npm view - 做一个 Ctrl+F(或等效的)来搜索
"time":{或"<your_version_number>" - 您可以在“时间”键下找到版本发布日期。
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/npmSearch 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!
例如,如果您想知道 npm 的 1.1.25 版(找不到 1.1.2 版)何时发布。您可以转到https://registry.npmjs.org/npm搜索“1.1.25”并进行迭代,直到在“时间”键下找到一个值或搜索"time":{(以更容易的方式为准),然后就可以了!
"time":{"modified":"2017-10-13T18:58:10.523Z","created":"2013-07-12T18:32:48.902Z","1.1.25":"2013-07-12T18:32:49.875Z"...
"时间":{"修改":"2017-10-13T18:58:10.523Z","创建":"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 :)
*丑,因为你必须解析 JSON 才能理解混乱:)
回答by Ogglas
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.
对于某些特定版本,我发现时间不存在,因此在运行该命令时未列出该包。要查看包的所有可用时间的列表,请运行以下命令:npm view <package> time。要查看所有版本和历史运行npm view <package> versions。

