How do I use npm to show the latest version of a module? I am expecting something like npm --latest express to print out v3.0.0.
The npm view prints the last version by release date. That might very well be an hotfix release for a older stable branch at times.
The solution is to list all versions and fetch the last one by version number
$ npm view versions --json | jq -r '.[-1]'
Or with awk instead of jq:
$ npm view --json | awk '/"$/{print gensub("[ \"]", "", "G")}'