npms-io / npms-analyzer

The analyzer behind https://npms.io
MIT License
319 stars 38 forks source link

Add flag for "has:bin" #153

Open blakeembrey opened 7 years ago

blakeembrey commented 7 years ago

This could be useful for people who are trying to find a package that provides a CLI counterpart. E.g. has:bin css or has:bin minify.

satazor commented 7 years ago

I like it and it would be easy to implement!

sindresorhus commented 5 years ago

I would go for has:cli css.

satazor commented 5 years ago

Oops closed by mistake. I will be writing here instructions on how to implement this feature in case anyone wants to work on this.

satazor commented 5 years ago

Here are the instructions:

  1. Add a bin field to the collected metadata here, which can be a direct copy of object defined the package bin field.
  2. Add the bin flag here
  3. Declare the bin field in the Elasticsearch index definition here, which should be a true if the bin object is empty or undefined, and true if it has at least one property
  4. Update the queries module so that it knows how to parse has:bin. Also, has:cli could be made an alias to has:bin

As you see, it should be really easy to add this feature in case anyone want to take on this.