Query npmjs registry via api

前端 未结 10 1595
走了就别回头了
走了就别回头了 2020-12-23 13:51

I find I\'m often unsatisfied with the ordering and expressiveness of searches on https://www.npmjs.com/. I guess there should be a way to programmatically query the server

10条回答
  •  伪装坚强ぢ
    2020-12-23 14:45

    You can always use the NPM registry client: https://github.com/npm/npm-registry-client.

    If you look through this you can get the endpoints for the API. e.g to get the dist-tags for a package then you can go to /-/package/packageName/dist-tags'

    So to get the babel-core dist tags you would go to http://registry.npmjs.org/-/package/babel-core/dist-tags

提交回复
热议问题