What’s wrong with the Search @ npmjs.com

Aleksandr Kubyshkin
3 min readSep 16, 2020

--

Like many other JS developers I often use npmjs.com for package searching. And since the last few years I have been engaged in site search technologies in 5sayer, all search issues are well known for me. I will try to tell what is wrong with current search implementation and will propose for better alternative.

Suggestions widget

Current suggestions widget

1) Most important. Very slow request processing speed — more than 1 second. This greatly reduces the comfort for the user and the effectiveness of this widget. For real comfort usability results should be shown less than in 200 ms.

2) Version information. Does user really need it? All unessential information should be removed to prevent UI littering.

3) Results are package names and half of them have descriptions. That’s too much information for user.

4) Sorting algorithm selects unpopular packages like react-datepicker-beta with “Weekly Downloads” = 1. Highly unlikely that user wants this package.

5) Trying to search package name with standard typo results in unpopular packages being shown:

Searching for “reakt” instead of “react”

It would be much more useful to correct a query implicitly and show results for corrected query. For example, like Google does:

Google query correction

6) No popular queries in suggestions — very useful feature for user.

7) One more userful feature — save search query in history and show it when input field gets a focus.

My proposed suggestions widget

Proposed suggestions widget

First 3 rows are most relevant package names highlighted with another color, next — popular queries.

Search page

Current search page

1) By default, npmjs uses so-called “Optimal” sorting, that provides non-optimal results actually and contains unpopular packages. It’s a good practice to sort by relevance by default and a sorting should consider package popularity as very important parameter for results scoring. For the given case there is no need to have other sorting options than a relevance.

2) There is no suggestion to correct misspelled query. For example, when user searches for reakt the Search should show:

My proposed search page

Proposed search page
  • Removed unessential information and cleared styles
  • Removed sorting option. By default, results are sorted by relevance that will take into account package quality, maintenance status, package page views count and many more.
  • Removed paging widget from the top. Only one at bottom makes sense.

In conclusion

The Search @ npmjs.com is a very important tool for any js-developer. It should be smart and relevant and have clear look and modern UI/UX. I hope, my ideas and proposals will be useful for guys from npmjs.com and JS Community will get improved Search soon.

--

--