npm determine all versions of a package code example
Example 1: npm display all versions
// nicely formatted npm package versions:
npm view <package-name> versions --json
Example 2: npm list version of package
npm view webpack versions --json
// nicely formatted npm package versions:
npm view <package-name> versions --json
npm view webpack versions --json