我正在寻找一种查询npm以返回相关结果的方法。我想把搜索整合到我的应用程序中。
F.e.如果我查询npm的“引导”,我将收到一堆结果,但是没有在第一页上 twitter引导包:
请求
curl https://npmsearch.com/query?q=bootstrap&fields=name,description,rating,version
结果
{"results":[{"name":["apta-bootstrap"],"version":["1.0.0"],"description":["apta bootstrap assets"]},{"name":["ender-bootstrap"],"version":["2.2.1"],"description":["Ender version of Twitter's Bootstrap JS (all plugins)"]},{"name":["bootstrap-extends"],"version":["1.0.1"],"description":["Useful extensions for Bootstrap 3"]},{"name":["bootstrap-submenu-hover"],"version":["2.0.8"],"description":["Bootstrap Sub-Menus"]},{"name":["bootstrap-submenu"],"version":["2.0.4"],"description":["Bootstrap Sub-Menus"]},{"name":["bootstrap-toggle-react"],"version":["0.1.6"],"description":["Bootstrap Toggle is a react component providing a toggle, based on www.bootstraptoggle.com"]},{"name":["bootstrap-layout-scrollable"],"version":["1.1.0"],"description":["Bootstrap Layout integration with Simplebar.js"]},{"name":["mithril-admin-bootstrap"],"version":["0.0.2"],"description":["Twitter Bootstrap plugin for mithril-admin"]},{"name":["bootstrap-checkbox"],"version":["1.4.0"],"description":["A checkbox component based on Bootstrap framework"]},{"name":["npmdoc-bootstrap-notify"],"version":["0.0.2"],"description":["#### api documentation for [bootstrap-notify (v3.1.3)](http://bootstrap-notify.remabledesigns.com/) [](https://www.npmjs.org/package/npmdoc-bootstrap-notify) [![tr"]}],"total":13546,"from":0}
如何提高国家防范机制搜索的实用性?
yarnpkg.com在提供一个很酷的搜索方面做得很好,但是该搜索似乎并不打算公开访问,即https://yarnpkg.com/en/packages?q=bootstrap&p=1
你有什么意见建议?
谢谢。
发布于 2017-08-27 15:06:49
更新:感谢约书亚·泰里尔的评论,新的正确的URL已经更新。
要查询npm包信息,可以使用npmjs.com的搜索URL:
https://registry.npmjs.com/-/v1/search?text=<search keyword>对Bootstrap来说,它是:
https://registry.npmjs.com/-/v1/search?text=bootstrap 推特的启动将是最好的结果。
https://stackoverflow.com/questions/45895045
复制相似问题