npm — NPM packages

The npm check examines the local NPM package database, and inserts that global packages are installed or missing.

It checks global packages, rather than packages specific to a particular package.json.


Check that a package is installed:

package = 'yarn'

Check that a particular version is installed:

package = 'typescript'
version = '3.6.4'

Check that a package is not installed:

package = 'express'
state = 'missing'

List of parameters

packagestringName of the package.
statestringState of the package. This can be 'present' or 'missing'.
versionstringIf installed, the version that should be present.