1

For research purpose, I am interested in getting a full list of npm package names. Some existing answer points to https://replicate.npmjs.com/registry/_all_docs, but the url is replicate.npmjs.com, and it seems to be a different registry than http://registry.npmjs.com/. For example, as of now, http://registry.npmjs.com/ 's doc_count is 1844996, but https://replicate.npmjs.com/ has 1419077.

What is the difference between registry.npmjs.com and replicate.npmjs.com? Are they the same or different registries? What are they used for? Which one is the "default" one used by the npm CLI?

Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32

2 Answers2

1

https://replicate.npmjs.com/registry/ supports scoped packages with %2f in the url:

Whereas as the https://registry.npmjs.org/ works for both

Also here's a incomplete doc about the registry endpoint: https://github.com/npm/registry/blob/master/docs/REPLICATE-API.md

zenoh
  • 2,071
  • 1
  • 22
  • 38
  • 1
    This answer is inaccurate. `replicate.npmjs.com` does support scoped packages, but the `/` must be URL encoded as `%2f` e.g. https://replicate.npmjs.com/registry/@sindresorhus%2fis – Matt Marston Jul 22 '22 at 21:15
0

The difference is that replicate.npmjs.com exposes the CouchDB _changes API that can be used to replicate information about packages in the primary npmjs registry (registry.npmjs.com).

If you are interested in performing research on all npm packages I suggest you take a look at this tutorial by the npm team: https://github.com/npm/registry-follower-tutorial