Class NpmPathResolver

java.lang.Object
com.diffplug.spotless.npm.NpmPathResolver
All Implemented Interfaces:
Serializable

public class NpmPathResolver extends Object implements Serializable
See Also:
  • Constructor Details

    • NpmPathResolver

      public NpmPathResolver(File explicitNpmExecutable, File explicitNodeExecutable, File explicitNpmrcFile, List<File> additionalNpmrcLocations)
  • Method Details

    • resolveNpmExecutable

      public File resolveNpmExecutable()
      Finds the npm executable to use.
      Either the explicit npm executable is returned, or - if an explicit node executable is configured - tries to find the npm executable relative to the node executable. Falls back to looking for npm on the user's system using NpmExecutableResolver
      Returns:
      the npm executable to use
      Throws:
      IllegalStateException - if no npm executable could be found
    • resolveNodeExecutable

      public File resolveNodeExecutable()
      Finds the node executable to use.
      Either the explicit node executable is returned, or tries to find the node executable relative to the npm executable found by resolveNpmExecutable().
      Returns:
      the node executable to use
      Throws:
      IllegalStateException - if no node executable could be found
    • resolveNpmrcContent

      public String resolveNpmrcContent()