@arcgis/create
Version:
The ArcGIS Maps SDK for JavaScript provides this CLI tool to streamline the process of creating a new web mapping application.
24 lines (20 loc) • 797 B
JavaScript
const majorNodeVersion = Number.parseInt(process.version.toString().replace("v", "").split(".")[0]);
if (majorNodeVersion < 22) {
console.error("You need to use Node.js version 22 or higher to run this program.");
process.exit(1);
}
/**
* the first argument is the path to the node executable
* the second argument is the path to the script file
* the third argument is the first argument to the script, which we hardcode to "init" if the user is running `create-arcgis`
* this makes it so that `npm init @arcgis` will work with no arguments from the user
*/
if (
process.argv.some((arg) => arg.includes("create")) &&
!process.argv.includes("--help") &&
!process.argv.includes("-h")
) {
process.argv.splice(2, 0, "init");
}
await import("../dist/init.js");