How do I fetch all npm packages that contain a given keyword

registry

(Benjamin Lupton) #1

So previously there was this stackoverflow question https://stackoverflow.com/q/13657140/130638

That recommended fetching all npm packages with the keyword docpad-plugin like so:

https://registry.npmjs.org/-/_view/byKeyword?startkey=["docpad-plugin"]&endkey=["docpad-plugin",{}]&group_level=2

Which is the technique used by https://github.com/wires/npm-keywordsearch and https://github.com/bevry/pluginclerk — the latter being what DocPad uses to fetch its plugins.

However, now that URL just returns an empty page:

HTTP/1.1 404 Not Found
Connection: keep-alive
Date: Wed, 11 Jul 2018 10:51:09 GMT
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
path=/; domain=.registry.npmjs.org; HttpOnly
Transfer-Encoding: chunked
npm-notice: this endpoint is deprecated



Thus breaking pluginclerk, thus breaking the DocPad web helper, and thus breaking DocPad.

What is the workaround? Is there any?


(Kat Marchán) #2

It’s deprecated, as it says. Use the search endpoint instead, which can filter by keywords:.


(Benjamin Lupton) #3

Great, thank you.

Seems the new call then is:

https://registry.npmjs.org/-/v1/search?text=keywords:docpad-plugin&size=250


(Benjamin Lupton) #4

pluginclerk is now updated for the new API


(system) #5

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.


(Kat Marchán) #6