staging/lib/vcap/staging/plugin/node/npm_support/npm_support.rb
# If there is no npm-shwrinkwrap.json file don't do anything
# If user has node_modules folder and config option "ignoreNodeModules"
# in cloudfoundry.json is not set don't do anything
# Otherwise, install node modules according to shwrinkwrap.json tree
#
# For each dependency in shrinkwrap tree recursively:
# - Get from cache by name & version
# - If not in cache, fetch it, run npm rebuild, put in cache
If there is no npm-shwrinkwrap.json file don't do anything
If user has node_modules folder and config option "ignoreNodeModules"
in cloudfoundry.json is not set don't do anything
Otherwise, install node modules according to shwrinkwrap.json tree

For each dependency in shrinkwrap tree recursively:
Get from cache by name & version
If not in cache, fetch it, run npm rebuild, put in cache
If there is no npm - shwrinkwrap . json file don ' t do anything If user has node_modules folder and config option " ignoreNodeModules " in cloudfoundry . json is not set don ' t do anything Otherwise install node modules according to shwrinkwrap . json tree For each dependency in shrinkwrap tree recursively : Get from cache by name & version If not in cache fetch it run npm rebuild put in cache
def install_packages(dependencies, where)
    dependencies.each do |name, props|
      package = NpmPackage.new(name, props["version"], where, @staging_uid,
                               @staging_gid, @npm_helper, @logger, @cache)
      installed_dir = package.install
      if installed_dir && props["dependencies"].is_a?(Hash)
        install_packages(props["dependencies"], installed_dir)
      end
    end
  end
def install_packages ( dependencies , where ) dependencies . each do | name , props | package = NpmPackage . new ( name , props [ "version" ] , where , @staging_uid , @staging_gid , @npm_helper , @logger , @cache ) installed_dir = package . install if installed_dir && props [ "dependencies" ] . is_a? ( Hash ) install_packages ( props [ "dependencies" ] , installed_dir ) end end end
If there is no npm-shwrinkwrap.json file don't do anything
If user has node_modules folder and config option "ignoreNodeModules"
in cloudfoundry.json is not set don't do anything
Otherwise, install node modules according to shwrinkwrap.json tree
If there is no npm - shwrinkwrap . json file don ' t do anything If user has node_modules folder and config option " ignoreNodeModules " in cloudfoundry . json is not set don ' t do anything Otherwise install node modules according to shwrinkwrap . json tree
dependencies
where