npms-io / npms-api

The https://npms.io API
MIT License
189 stars 30 forks source link

Find packages by keyword #42

Closed sindresorhus closed 8 years ago

sindresorhus commented 8 years ago

It's a very common need to be able to find packages according to one or more keywords.

It is possible with the npm API, but it's undocumented, slow, and you can only fetch by one keyword at the time.

You already have the data, so would be nice to expose a keyword API endpoint.

satazor commented 8 years ago

Agreed, this goes inline with #29

satazor commented 8 years ago

@sindresorhus How do you expect the keywords matching to happen? Exact match or some degree of fuzziness similar to the search term?

satazor commented 8 years ago

@sindresorhus please answer on #29, closing this as duplicate

sindresorhus commented 8 years ago

Exact. I would like to find, for example, all packages with the keyword gulpplugin. I wouldn't want grunt tasks to show up then, just because they have the gruntplugin keyword, which is very close.

satazor commented 8 years ago

@sindresorhus Aright, will do exact match.

satazor commented 8 years ago

@sindresorhus another question, if you specify multiple keywords do you expect the operator to be AND or OR?

sindresorhus commented 8 years ago

Hard to say. I can't think of when I would need multiple keywords at all. I guess if you really want it and there has to be only one of those operators, I would go with OR, as it's unlikely many packages has the same multiple keywords.

satazor commented 8 years ago

Agree, thanks for the feedback!