menu

Search By Label

This command shows data about a package and prints it to stdout.
As an example, to view information about the connect package from the registry, you would run:

npm view connect

And you can see all versions using:
npm view connect versions
To see the current version of any package installed in your project from the console, you can use the following npm command:

npm list webpack

This command will display the version of the package installed locally in your project along with its dependencies.
Look for the package entry in the output to see the version number.
The npm show command is used to display detailed information about a package available on the npm registry. 
This command provides information such as the package's metadata, versions, maintainers, dependencies, and more. It's a useful tool when you want to inspect details about a package without necessarily installing it.

Here is the basic syntax of the npm show command:
npm show <package-name>

Keep in mind that npm show retrieves information directly from the npm registry, so it doesn't require the package to be installed locally. It's a convenient way to inspect package details before deciding to install or use a particular version.
npm-check-updates upgrades your package.json dependencies to the latest versions, ignoring specified versions.

Source: npm-check-updates - npm (npmjs.com)
To check if any module in a project is 'old':
npm outdated
'outdated' will check every module defined in package.json and see if there is a newer version in the NPM registry.

CDN
Use CDN if you are developing a website that will be accessible by public internet users.

CDN Benefits:
  • Will be cached on most browsers because it's used by a lot of other websites
  • Reduce the bandwidth

NPM
npm is a great tool for managing your app's dependencies using a module bundler.

Example:

assume using a webpack module bundler and jQuery is installed
import $ from 'jQuery'
...
var content = $('#id').html();

but the browser does not understand the import statement so you have to transpile the code with Webpack commands, the bundler will check all the used dependencies and bind them in a single file without any dependency problems.

Source: javascript - Using CDN vs Installing library by NPM - Stack Overflow