6

There are dozens of modules available out there, many fulfilling the same task. For instance, the list of router modules alone contains 26 modules.

Given a list of modules, how can I pick the best for my needs? I am looking for one that is maintained, tested, and with some inertia, but I'm not sure how to figure out which of these modules fit that criteria.

3
  • 2
    See which GitHub project has the most stars, forks and was updated somewhat recently. Or search the NPM and order by popularity: npmjs.org/search?q=router
    – Blender
    May 5, 2013 at 22:50
  • The most popular ones are Connect, Crossroads.js and Journey (in that order).
    – Blender
    May 5, 2013 at 22:53
  • Are you asking for which one is the best, or asking for advice so you will understand how to pick the best? I'm asking considering the answer you just received was the former but you seem to be asking for the latter. May 5, 2013 at 23:03

2 Answers 2

4

This answer is based on a talk a few weeks ago in San Francisco by Isaac Schlueter (npm author, took over node.js responsibilities from Ryan Dahl, works at Joyent - https://twitter.com/izs )

Isaac's main project now is to improve the NPM to help people figure out the quality of packages.

Before efore the npmjs.org website gets smarter, here are factors to consider (some already listed by @3boll )

Factors

  1. Number of downloads
  2. How recently updated
  3. History of updates (has it bin updated often over a long period of time)
  4. Number of contributors
  5. Have well-known/trusted developers and maintainers starred it? [a]
  6. Do other important packages depend on it? [b]
  7. Is the package well-documented and have it's own website?
  8. Does the module have test coverage?

Github factors: updated: As of npm 1.2.20 and forward, modules without repository fields will show a missing repository fields warning. (Nice touch to put a little pressure on people to package up their modules correctly.)

  1. Number of forks
  2. Number of commits
  3. Are issues being closed on github, or have the same issues been open for a long time?

[a] example of starred

https://npmjs.org/~tjholowaychuk

[b] to quickly see from terminal:

npm view <name_of_module> dependencies

example: npm view connect dependencies

https://npmjs.org/browse/depended

CAVEATS:

Popular doesn't mean being good. There are a lot of modules that are not popular that are really good.

Inaccurate "last updated". NPM may show a the module has been updated 2 years ago, but the github has been updated in last week. This happens if maintainer doesn't update version number as code changes on github.

2
  • Thanks for the in-depth answer, it will definitely be useful. May 7, 2013 at 17:29
  • Your welcome! I made it a community-wiki so others can update it too. May 7, 2013 at 18:34
1

This module(middleware layer for Node.js) meets your requirements:

connect — Robust high performance middleware framework

Forks about 500

+1000 commits

last update: 7 days ago.

569 npm packages depends on these module https://npmjs.org/browse/depended

p.s. I have nothing to do with the development of the module, is just my recommendation.

1
  • 1
    My question was more about how to pick the best, and not which router is the best. But looking at the number of forks, number of commits, last update and dependencies is interesting. Upvoted. May 6, 2013 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.