How am I supposed to find out what is the latest stable version of an npm package?

npm

Solution

Use `npm view [package-name] dist-tags` in the command line.

Example:

$ npm view express dist-tags

{ latest: '2.5.9',
  '3.0': '3.0.0beta2' }

Problem

How can I find the latest stable version of an npm package? Other than going to http://search.npmjs.org and searching for it? I usually need the version to put it in my `package.json`.

Original source