Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I choose a node module?

Tags:

node.js

module

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.

like image 361
toasted_flakes Avatar asked May 05 '13 22:05

toasted_flakes


2 Answers

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.

like image 71
7 revs Avatar answered Oct 11 '22 15:10

7 revs


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.

like image 25
jmingov Avatar answered Oct 11 '22 15:10

jmingov