Specsheet

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.

Examples

Check that a package is installed:

[[npm]]
package = 'yarn'

Check that a particular version is installed:

[[npm]]
package = 'typescript'
version = '3.6.4'

Check that a package is not installed:

[[npm]]
package = 'express'
state = 'missing'

List of parameters

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