Manage and query NPM packages.
salt.modules.npm.
install
(pkg=None, pkgs=None, dir=None, runas=None, registry=None, env=None)¶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 list of package names in the same format as the name
parameter
New in version 2014.7.0.
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.
CLI Example:
salt '*' npm.install coffee-script
salt '*' npm.install [email protected]
salt.modules.npm.
list_
(pkg=None, dir=None, runas=None, env=None)¶List installed NPM packages.
If no directory is specified, this will return the list of globally- installed packages.
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.
CLI Example:
salt '*' npm.list
salt.modules.npm.
uninstall
(pkg, dir=None, runas=None)¶Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
CLI Example:
salt '*' npm.uninstall coffee-script