Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query npmjs registry via api

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 using https://api.npmjs.org/ or http://registry.npmjs.org/. But how? Where is the documentation?

(Or are there node packages to faciliate that? I know SO isn't about tool or package recommendations, so perhaps I shouldn't be asking about this as well, but if there were some tool, I could likely read the API from that as well.)

like image 308
MvG Avatar asked Dec 03 '15 16:12

MvG


People also ask

What is Npmjs registry?

The public npm registry is a database of JavaScript packages, each comprised of software and metadata. Open source developers and developers at companies use the npm registry to contribute packages to the entire community or members of their organizations, and download packages to use in their own projects.

Does npm have an API?

While many people regularly use npm's website to discover packages, only a few know that npm also provides a public REST API accessible at registry.npmjs.org. This API provides methods to: Get information about the registry itself. Get all available information about a specific package.

How do I check my npm registry?

You can show the registry of a specific package with the npm view command. When you use npm config get registry you will see the default registry.

Is npm registry open-source?

The most common registry that open source developers and organization across the world use is public NPM registry but it is not the only registry we have.


1 Answers

There is a really good npm query site https://npms.io which I am using for years on my web project. It is an open-source project and supports advanced search with a better quality of the results for the keywords.

They have a scoring system for each package using the collected information about the project. The final score is calculated based on four different aspects of Quality, Maintenance, Popularity, and Personalities.

It also has very neat REST API.
API Doc: https://api-docs.npms.io

like image 123
Dipu Raj Avatar answered Sep 27 '22 22:09

Dipu Raj