npm is the package manager for Node.js. As of today, there are 77,588 modules registered with npm. That there lies the problem.
Anybody can create an account and publish a Node module to npm. There’s no quality control. Half of them are crap or have been abandoned. I expect there to be even more abandoned modules once Node.js 0.12 is released and authors don’t bother to update their native modules to the new V8 interface.
Finding new modules is a pain. There are a couple of npm search sites including npm’s own site, but these search engines suck.
For example, I was recently looking for a Node module that incorporates Hogan.js into Express. Simple right? When I search “hogan express”, the first hit is express. Well that’s half right. The second hit is the hogan-express module which is exactly what I’m looking for. However if I continue to scroll down the results I see hogan-engine, hogan-middleware, express-hogan, and hjs. Ugh. I smell crap.
On a side tangent, it’s a huge annoyance that package names are first come, first serve. If I create an “express4” module, I bet it wouldn’t be long before the world gets confused and tries to download it. Case in point, there’s a module named express-hogan and another named express-hogan.js. WTF? There needs to be some name cops that prevents this shit.
So, now I have 5 modules that I need to research to see which ones suck and which ones suck the least. A quick look at each module and I can see the following:
|Last Updated:||5 months ago||a year ago||a year ago||9 months ago||9 months ago|
Note: I had to go to npm-stat to get the download numbers.
It came down to hogan-express vs hjs. I ended up using hogan-express for my Express app because it had support out-of-the-box for layouts and partials. It also helped that hogan-express was always one of the first results. It’s pretty easy to use once you figure out how to use it. The examples in the docs are written CoffeeScript which only complicates my already overworked brain.
So, what about other npm search sites?
https://nodejsmodules.org/ just lists the usual suspects. I have no idea what criteria they use to determine which modules are interesting. This site is basically useless.
http://node-modules.com/ is just a keyword search engine. I tried searching for “hogan express” and it wasn’t until the 3rd result did it return “hogan-express”. The next couple results seemed relevant. One thing that bugs me is the stupid package name links to the module’s Github page instead of the npm page. One more step I need to do to find the stats about the module. Ugh.
http://npmsearch.com/ is the most worthless of the bunch. I searched “hogan express” and the first Hogan.js+Express module was the 59th result! WTF??? Even specifying “hogan-express” didn’t yield any results. I wouldn’t waste my time with this site.
In the end, npm’s site provides the best search even though it’s not perfect. I wish there was a rating system. The star system is not enough. I want to know how many forks does the module have? How many issues does it have? Has the module been abandoned? The search index should index not only the module name, description, and keywords, but also the main readme.