[英]Where can I get NPM package information from a Github Repository?
I want to be able to get a few information about NPM packages in a Javascript based repository on Github.我希望能够在 Github 上基于 Javascript 的存储库中获得有关 NPM 包的一些信息。
I want to believe I can see them from the package.json file the repositories.我想相信我可以从存储库的 package.json 文件中看到它们。
Please any help or guideline on this?.请对此有任何帮助或指导吗?
I will like to extract the needed information using powershell from the file.我想使用 powershell 从文件中提取所需的信息。
Determine the URL for the raw content of the package.json
file of interest:为感兴趣的
package.json
文件的原始内容确定 URL:
json5
package , click on the Repository
link to go to the associated GitHub repository , navigate to the package.json
file and click on the Raw
button to get the raw URL . json5
package , click on the Repository
link to go to the associated GitHub repository , navigate to the package.json
file and click on the Raw
button to get the raw URL . Then use Invoke-RestMethod
with the raw URL to retrieve and parse the content of the package's package.json
file:然后使用
Invoke-RestMethod
和原始 URL 来检索和解析包的package.json
文件的内容:
PS> Invoke-RestMethod https://raw.githubusercontent.com/json5/json5/master/package.json
name : json5
version : 2.2.0
description : JSON for humans.
main : lib/index.js
module : dist/index.mjs
bin : lib/cli.js
browser : dist/index.js
types : lib/index.d.ts
files : {lib/, dist/}
engines : @{node=>=6}
scripts : @{build=rollup -c; build-package=node build/package.js; build-unicode=node build/unicode.js; coverage=tap --coverage-report html test; lint=eslint --fix .; prepublishOnly=npm run production; preversion=npm run production; production=npm run lint && npm test && npm run build; test=tap -Rspec --100 test; version=npm run build-package && git add package.json5}
repository : @{type=git; url=git+https://github.com/json5/json5.git}
keywords : {json, json5, es5, es2015…}
author : Aseem Kishore <aseem.kishore@gmail.com>
contributors : {Max Nanasy <max.nanasy@gmail.com>, Andrew Eisenberg <andrew@eisenberg.as>, Jordan Tucker <jordanbtucker@gmail.com>}
license : MIT
bugs : @{url=https://github.com/json5/json5/issues}
homepage : http://json5.org/
dependencies : @{minimist=^1.2.5}
devDependencies : @{core-js=^2.6.5; eslint=^5.15.3; eslint-config-standard=^12.0.0; eslint-plugin-import=^2.16.0; eslint-plugin-node=^8.0.1; eslint-plugin-promise=^4.0.1; eslint-plugin-standard=^4.0.0; regenerate=^1.4.0; rollup=^0.64.1; rollup-plugin-buble=^0.19.6; rollup-plugin-commonjs=^9.2.1; rollup-plugin-node-resolve=^3.4.0; rollup-plugin-terser=^1.0.1; sinon=^6.3.5; tap=^12.6.0; unicode-10.0.0=^0.7.5}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.