npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

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

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?


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


Great, thank you.

Seems the new call then is:

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


pluginclerk is now updated for the new API