npm outdated

Find outdated npm packages
Simply run the below script and it will show you the packages you want to update
The results will have the below columns:
Sl No.
Package
Type
Current
Wanted
Latest
Here is the working script.
npm outdated --json 2>/dev/null \
| jq -r '
to_entries[]
| [.key,
(.value.type // "-"),
(.value.current // "-"),
(.value.wanted // "-"),
(.value.latest // "-")]
| @tsv
' \
| sort -t$'\t' -k4V \
| awk 'BEGIN {print "S.No\tPackage\tType\tCurrent\tWanted\tLatest"} {print NR "\t" $0}' \
| column -s $'\t' -t
Output looks like this





