public enum Platform extends Enum<Platform>
Enum Constant and Description |
---|
LINUX
Running on a Linux operating system
|
MAC
Running on Mac OS (Darwin)
|
WINDOWS
Running on a Windows operating system
|
Modifier and Type | Field and Description |
---|---|
String |
archiveExtension
Contains the Node.js archive extension.
|
static Platform |
CURRENT
Contains the current
Platform . |
String |
node
Contains name of node executable, either "node" or "node.exe".
|
String |
nodeClassifier
Contains the Node.js classifier: "linux-x64", "darwin-x64" or "win-x64"
|
String |
npm
Contains name of npm executable, either "npm" or "npm.cmd".
|
String |
npx
Contains name of npx executable, either "npx" or "npx.cmd".
|
Modifier and Type | Method and Description |
---|---|
String |
getDownloadPath(String nodeVersion)
Calculates the relative Node.js download path.
|
String |
getNodePath(String nodeVersion) |
String |
getNpmPath(String nodeVersion) |
String |
getNpxPath(String nodeVersion) |
boolean |
isWindows() |
static Platform |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Platform[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Platform LINUX
public static final Platform MAC
public static final Platform WINDOWS
public final String archiveExtension
public final String node
public final String nodeClassifier
public final String npm
public final String npx
public static Platform[] values()
for (Platform c : Platform.values()) System.out.println(c);
public static Platform valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getDownloadPath(String nodeVersion)
nodeVersion
- the Node.js versionpublic String getNodePath(String nodeVersion)
nodeVersion
- the Node.js versionpublic String getNpmPath(String nodeVersion)
nodeVersion
- the Node.js versionpublic String getNpxPath(String nodeVersion)
nodeVersion
- the Node.js versionpublic boolean isWindows()
true
if the current platform is WINDOWS
.Copyright © 2023. All rights reserved.