Module Expr Str ImportFrom alias ImportFrom alias alias Import alias identifier FunctionDef arguments args defaults body Expr Str Return TupleLoad IfExp CompareIn Str NameLoad Str NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict If CompareIsNot NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore ListLoad NameLoad TryExcept body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad orelse Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIn NameLoad NameLoad CompareIn Str SubscriptLoad NameLoad Index NameLoad body Return NameLoad orelse If CompareIn Str NameLoad body For NameStore Call AttributeLoad NameLoad attr body TryExcept body Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Index Num If CompareEq SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num NameLoad body Return NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad decorator_list For NameStore NameLoad body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Continue If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Continue Assign NameStore Call AttributeLoad Str attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str If NameLoad body If CompareNotEq Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Continue orelse Expr Call AttributeLoad NameLoad attr NameLoad Continue If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore ListLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str Dict Str Str ListLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad Return NameLoad TryExcept body Assign NameStore Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad If BoolOpAnd NameLoad BoolOpOr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Dict Str Str ListLoad NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict TryExcept body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad If Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index NameLoad Str Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict If SubscriptLoad NameLoad Index Str body TryExcept body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Dict Str Str ListLoad NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad TryExcept body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Str Return NameLoad If Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Str orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Dict NameLoad Str Assign SubscriptStore NameLoad Index Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict Assign NameStore NameLoad TryExcept body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr BoolOpOr NameLoad Str NameLoad Return NameLoad If NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr BoolOpOr NameLoad Str Return NameLoad If Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index BoolOpOr NameLoad Str Str Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr BoolOpOr NameLoad Str orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr BoolOpOr NameLoad Str Return NameLoad decorator_list
N/A N/A 
Installation of NPM Packages
============================

These states manage the installed packages for node.js using the Node Package
Manager (npm). Note that npm must be installed for these states to be
available, so npm states should include a requisite to a pkg.installed state
for the package which provides npm (simply ``npm`` in most cases). Example:

.. code-block:: yaml

    npm:
      pkg.installed

    yaml:
      npm.installed:
        - require:
          - pkg: npm
 __future__ absolute_import salt.exceptions CommandExecutionError CommandNotFoundError N/A salt.ext.six six __virtual__ N/A N/A N/A N/A N/A 
    Only load if the npm module is available in __salt__
     N/A N/A N/A N/A npm.list __salt__ npm False 'npm' binary not found on system N/A installed N/A N/A name pkgs dir user force_reinstall registry env N/A None None None False None None N/A N/A 
    Verify that the given package is installed and is at the correct version
    (if specified).

    .. code-block:: yaml

        coffee-script:
          npm.installed:
            - user: someuser

        coffee-script@1.0.1:
          npm.installed: []

    name
        The package to install

        .. versionchanged:: 2014.7.2
            This parameter is no longer lowercased by salt so that
            case-sensitive NPM package names will work.

    pkgs
        A list of packages to install with a single npm invocation; specifying
        this argument will ignore the ``name`` argument

        .. versionadded:: 2014.7.0

    dir
        The target directory in which to install the package, or None for
        global installation

    user
        The user to run NPM with

        .. versionadded:: 0.17.0

    registry
        The NPM registry from which to install the package

        .. versionadded:: 2014.7.0

    env
        A list of environment variables to be set prior to execution. The
        format is the same as the :py:func:`cmd.run <salt.states.cmd.run>`.
        state function.

        .. versionadded:: 2014.7.0

    force_reinstall
        Install the package even if it is already installed
     N/A ret N/A name result comment changes name None N/A N/A N/A pkgs None N/A N/A pkg_list pkgs N/A N/A pkg_list N/A name N/A N/A N/A installed_pkgs N/A N/A __salt__ N/A npm.list dir dir runas user env env N/A N/A N/A N/A CommandNotFoundError CommandExecutionError N/A err N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error looking up {0!r}: {1} format name err N/A ret N/A N/A installed_pkgs N/A dict N/A N/A p info N/A N/A p info N/A N/A six iteritems installed_pkgs N/A pkgs_satisfied N/A N/A pkgs_to_install N/A _pkg_is_installed N/A N/A pkg installed_pkgs N/A N/A N/A 
        Helper function to determine if a package is installed

        This performs more complex comparison than just checking
        keys, such as examining source repos to see if the package
        was installed by a different name from the same repo

        :pkg str: The package to compare
        :installed_pkgs: A dictionary produced by npm list --json
         N/A N/A N/A pkg_name installed_pkgs N/A version N/A installed_pkgs N/A pkg_name N/A N/A True N/A N/A N/A :// pkg_name N/A N/A pkg_details N/A N/A installed_pkgs values N/A N/A N/A N/A pkg_from N/A N/A N/A N/A N/A pkg_details get from split :// N/A 1 N/A N/A N/A N/A N/A pkg_name split :// N/A 1 pkg_from N/A N/A True N/A N/A N/A IndexError N/A N/A N/A False N/A N/A pkg pkg_list N/A N/A N/A pkg_name _ pkg_ver N/A N/A pkg partition @ N/A pkg_name N/A N/A pkg_name strip N/A N/A force_reinstall True N/A N/A N/A N/A pkgs_to_install append pkg N/A N/A N/A N/A _pkg_is_installed pkg installed_pkgs N/A N/A N/A N/A pkgs_to_install append pkg N/A N/A installed_name_ver N/A N/A {0}@{1} format pkg_name N/A N/A installed_pkgs N/A pkg_name N/A version N/A pkg_ver N/A N/A N/A N/A N/A N/A installed_pkgs N/A pkg_name get version pkg_ver N/A N/A N/A N/A pkgs_to_install append pkg N/A N/A N/A N/A pkgs_satisfied append installed_name_ver N/A N/A N/A N/A N/A pkgs_satisfied append installed_name_ver N/A N/A N/A __opts__ N/A test N/A N/A N/A ret N/A result None N/A comment_msg N/A N/A pkgs_to_install N/A N/A N/A N/A comment_msg append N/A N/A NPM package(s) {0!r} are set to be installed format N/A N/A ,  join pkgs_to_install N/A N/A ret N/A changes N/A old new N/A pkgs_to_install N/A pkgs_satisfied N/A N/A N/A N/A comment_msg append N/A N/A Package(s) {0!r} satisfied by {1} format N/A N/A ,  join pkg_list N/A N/A ,  join pkgs_satisfied N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A .  join comment_msg N/A ret N/A N/A pkgs_to_install N/A N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A Package(s) {0!r} satisfied by {1} format N/A N/A ,  join pkg_list N/A N/A ,  join pkgs_satisfied N/A ret N/A N/A N/A cmd_args N/A dir runas registry env pkgs dir user registry env pkg_list N/A call N/A N/A __salt__ N/A npm.install cmd_args N/A N/A N/A N/A CommandNotFoundError CommandExecutionError N/A err N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error installing {0!r}: {1} format N/A N/A ,  join pkg_list err N/A ret N/A N/A call N/A N/A isinstance call list N/A isinstance call dict N/A N/A N/A ret N/A result True N/A N/A ret N/A changes N/A old new N/A pkgs_to_install N/A N/A ret N/A comment N/A N/A Package(s) {0!r} successfully installed format N/A N/A ,  join pkgs_to_install N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Could not install package(s) {0!r} format N/A N/A ,  join pkg_list N/A ret N/A removed N/A N/A name dir user N/A None None N/A N/A 
    Verify that the given package is not installed.

    dir
        The target directory in which to install the package, or None for
        global installation

    user
        The user to run NPM with

        .. versionadded:: 0.17.0
     N/A ret N/A name result comment changes name None N/A N/A N/A N/A installed_pkgs N/A N/A __salt__ N/A npm.list dir dir N/A N/A N/A N/A CommandExecutionError CommandNotFoundError N/A err N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error uninstalling {0!r}: {1} format name err N/A ret N/A N/A name installed_pkgs N/A N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A Package {0!r} is not installed format name N/A ret N/A N/A __opts__ N/A test N/A N/A N/A ret N/A result None N/A N/A ret N/A comment N/A N/A Package {0!r} is set to be removed format name N/A ret N/A N/A N/A __salt__ N/A npm.uninstall pkg name dir dir runas user N/A N/A N/A ret N/A result True N/A N/A N/A ret N/A changes N/A name Removed N/A N/A ret N/A comment N/A N/A Package {0!r} was successfully removed format name N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error removing package {0!r} format name N/A ret N/A bootstrap N/A N/A name user silent N/A None True N/A N/A 
    Bootstraps a node.js application.

    Will execute 'npm install --json' on the specified directory.

    user
        The user to run NPM with

        .. versionadded:: 0.17.0
     N/A ret N/A name result comment changes name None N/A N/A N/A __opts__ N/A test N/A N/A N/A N/A call N/A N/A __salt__ N/A npm.install dir name runas user pkg None silent silent dry_run True N/A N/A N/A N/A CommandNotFoundError CommandExecutionError N/A err N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error Bootstrapping {0!r}: {1} format name err N/A ret N/A N/A ret N/A result None N/A N/A ret N/A changes N/A old new N/A call N/A N/A ret N/A comment N/A N/A {0} is set to be bootstrapped format name N/A ret N/A N/A N/A call N/A N/A __salt__ N/A npm.install dir name runas user pkg None silent silent N/A N/A N/A N/A CommandNotFoundError CommandExecutionError N/A err N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error Bootstrapping {0!r}: {1} format name err N/A ret N/A N/A call N/A N/A N/A ret N/A result True N/A N/A ret N/A comment Directory is already bootstrapped N/A ret N/A N/A isinstance call str N/A N/A N/A ret N/A result False N/A N/A ret N/A changes call N/A N/A ret N/A comment Could not bootstrap directory N/A N/A N/A ret N/A result True N/A N/A ret N/A changes N/A name Bootstrapped N/A N/A ret N/A comment Directory was successfully bootstrapped N/A ret N/A cache_cleaned N/A N/A name user N/A None None N/A N/A 
    Ensure that the given package is not cached.

    If no package is specified, this ensures the entire cache is cleared.

    name
        The name of the package to remove from the cache, or None for all packages

    user
        The user to run NPM with
     N/A ret N/A name result comment changes name None N/A N/A specific_pkg None N/A N/A N/A cached_pkgs N/A N/A __salt__ N/A npm.cache_list path name runas user N/A N/A N/A N/A CommandExecutionError CommandNotFoundError N/A err N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error looking up cached {0}: {1} format N/A name packages err N/A ret N/A name N/A N/A all_cached_pkgs N/A N/A __salt__ N/A npm.cache_list path None runas user N/A cache_root_path N/A all_cached_pkgs N/A 0 N/A specific_pkg N/A N/A {0}/{1}/ format cache_root_path name N/A N/A specific_pkg cached_pkgs N/A N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A Package {0} is not in the cache format name N/A ret N/A N/A __opts__ N/A test N/A N/A N/A ret N/A result None N/A N/A ret N/A comment N/A N/A Cached {0} set to be removed format N/A name packages N/A ret N/A N/A N/A __salt__ N/A npm.cache_clean path name runas user N/A N/A N/A ret N/A result True N/A N/A N/A ret N/A changes N/A N/A name cache Removed N/A N/A ret N/A comment N/A N/A Cached {0} successfully removed format N/A name packages N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Error cleaning cached {0} format N/A name packages N/A ret N/A