Manage and query NPM packages.
Clean cached NPM packages.
If no path for a specific package is provided the entire cache will be cleared.
The cache subpath to delete, or None to clear the entire cache
The user to run NPM with
Environment variables to set when invoking npm. Uses the same env
format as the cmd.run
execution
function.
Force cleaning of cache. Required for npm@5 and greater
New in version 2016.11.6.
CLI Example:
salt '*' npm.cache_clean force=True
List NPM cached packages.
If no path for a specific package is provided this will list all the cached packages.
The cache subpath to list, or None to list the entire cache
The user to run NPM with
Environment variables to set when invoking npm. Uses the same env
format as the cmd.run
execution
function.
CLI Example:
salt '*' npm.cache_clean
List path of the NPM cache directory.
The user to run NPM with
Environment variables to set when invoking npm. Uses the same env
format as the cmd.run
execution
function.
CLI Example:
salt '*' npm.cache_path
Install an NPM package.
If no directory is specified, the package will be installed globally. If no package is specified, the dependencies (from package.json) of the package in the given directory will be installed.
A package name in any format accepted by NPM, including a version identifier
A list of package names in the same format as the name
parameter
New in version 2014.7.0.
The target directory in which to install the package, or None for global installation
The user to run NPM with
The NPM registry to install the package from.
New in version 2014.7.0.
Environment variables to set when invoking npm. Uses the same env
format as the cmd.run
execution
function.
New in version 2014.7.0.
Whether or not to run NPM install with --silent flag.
New in version 2016.3.0.
Whether or not to run NPM install with --dry-run flag.
New in version 2015.8.4.
Whether or not to run NPM install with --silent flag.
New in version 2015.8.5.
CLI Example:
salt '*' npm.install coffee-script
salt '*' npm.install coffee-script@1.0.1
List installed NPM packages.
If no directory is specified, this will return the list of globally- installed packages.
Limit package listing by name
The directory whose packages will be listed, or None for global installation
The user to run NPM with
New in version 2014.7.0.
Environment variables to set when invoking npm. Uses the same env
format as the cmd.run
execution
function.
New in version 2014.7.0.
Limit the depth of the packages listed
New in version 2016.11.6,2017.7.0.
CLI Example:
salt '*' npm.list
Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
A package name in any format accepted by NPM
The target directory from which to uninstall the package, or None for global installation
The user to run NPM with
Environment variables to set when invoking npm. Uses the same env
format as the cmd.run
execution
function.
New in version 2015.5.3.
CLI Example:
salt '*' npm.uninstall coffee-script