Closed montogeek closed 8 years ago
In addition to @montogeek request, looking for the ability to search for multiple terms (ala npm install)
$http.get('https://api.npms.io/search', {
json: true,
query: {
term: 'gulp-messenger gulp-phpunit gulp-phpspec',
}
In addition, this could be expanded to support @montogeek request
$http.get('https://api.npms.io/search', {
json: true,
query: {
author: 'mikeerickson',
keyword: 'gulp'
}
Support searching by keywords and author seems a good addition, we will definitively add those.
@mikeerickson we support multiple terms but they are used as AND and not OR.
I'm currently looking into implementing this.
Regarding author:
If you open https://www.npmjs.com/~satazor, it shows all modules that I am qualified as a maintainer. When people are filtering by author what are they expecting? As you see author is a bit ambiguous.
Possible solutions:
?maintainer=satazor
Suggestions?
//cc @sindresorhus
Agreed. Should be the npm users with publish rights. ?maintainer=satazor
looks good.
@sindresorhus thanks for the feedback
The way I'm implementing it is not as a query parameter, but instead with ?q=query
, where the query must obey a DSL. It looks similar to GitHub when you are searching for issues. Examples:
maintainer:satazor exclude:deprecated keywords:windows,macosx cross-spawn
maintainer:sindresorhus exclude:insecure promise
score-effect:10 maintenance-weight:20 test runner
This is a breaking change in the search API but I will support the old ?term
API until December. Having that said, it will support maintainer:satazor
and also add author
and publisher
support as I described above.
I've done some work and I got this stuff working locally. But since this is a breaking change I got to setup API versioning and ensure everything is done smoothly. Here's the API doc for the query DSL that allows advanced filtering and modifiers:
I expect to get this deployed in the next 4 days.
Hi!
Great project!
I would like to ask about advanced queries, such as search by author or keywords as http://npmsearch.com/ do.