Node Roundup: npm Search Ranking, shortest-route, prova

2014-03-26 00:00:00 +0000 by Alex R. Young

npm Search Ranking

Improved search results.

npm's search results are now ranked by popularity:

Packages are now scored by a nifty new algorithm that takes into account the package's popularity (i.e. number of stars and average weekly downloads over a month). The algorithm also does some proper word parsing (so you can actually find "socket.io" with the search "socket io") and gives higher weight to things that match the search query in the package name and details.

The interface has been tweaked as well, so you can easily see how many downloads and starts a project has.

I was sceptical about the quality of the results, but I've recently been researching material for my book so I've been searching npm a lot, and generic searches now seem to get more useful results.


Shortest-route (GitHub: tarun29061990 / shortest-route, License: ISC, npm: shortest-route) by Tarun Chaudhary is a travelling salesman problem solver that you can install with npm.

It calculates the distance between cities using the Google Distance Matrix API, and accepts city descriptions as a pipe-separated list:

var shortestRoute = require('shortest-route');

shortestRoute.getShortPath('A|B|C', function(json) {

Although you probably won't need this for a project any time soon, I like the fact a hard problem is installable with npm. For more details, see Tarun's blog post.


Automatically running tests when files change.

I like tape by Substack -- it's easy to read and produces flexible test output. Azer also likes it, so he wrote prova (GitHub: azer / prova, License: GPL, npm: prova), a Node and browser test runner based on tape and browserify.

It has a built-in web application that uses watchify to automatically run tests when files change. That means you can edit code and see live results in a browser.