Package com.diffplug.spotless.npm
Class NpmPathResolver
- java.lang.Object
-
- com.diffplug.spotless.npm.NpmPathResolver
-
public class NpmPathResolver extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
resolveNodeExecutable()
Finds the node executable to use.File
resolveNpmExecutable()
Finds the npm executable to use.String
resolveNpmrcContent()
-
-
-
Method Detail
-
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 usingNpmExecutableResolver
- 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 byresolveNpmExecutable()
.- Returns:
- the node executable to use
- Throws:
IllegalStateException
- if no node executable could be found
-
resolveNpmrcContent
public String resolveNpmrcContent()
-
-