How to use the command-line-args.parse function in command-line-args

To help you get started, we’ve selected a few command-line-args examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github develar / onshape-desktop-shell / build / build.js View on Github external
"use strict"

const fs = require("fs")
const path = require("path")
const util = require("./util")

const args = require("command-line-args")([
  {name: "build", type: Boolean, defaultValue: false},
  {name: "sign", type: String},
  {name: "platform", type: String, defaultValue: process.platform},
  {name: "arch", type: String, defaultValue: "all"},

let outDir = path.join(__dirname, "/../dist") + "/"
const isMacBuild = args.platform === "darwin"
if (isMacBuild) {
  outDir += "Onshape-darwin-x64"
else {
  outDir += "win"
outDir = path.normalize(outDir)
console.log("Removing " + outDir)
github develar / onshape-desktop-shell / build / install-production-deps.js View on Github external
"use strict"

const args = require("command-line-args")({name: "arch", type: String}).parse()


A mature, feature-complete library to parse command-line options.

Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Popular command-line-args functions