New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More ā†’
Socket
Sign inDemoInstall
Socket

node-command-line-starter-1

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-command-line-starter-1 - npm Package Compare versions

Comparing version 2.1.2 to 2.1.5

9

package.json
{
"name": "node-command-line-starter-1",
"version": "2.1.2",
"version": "2.1.5",
"author": "Himanshu @himanshu-dixit",

@@ -41,3 +41,3 @@ "repository": "crusherdev/CLI",

"semantic-release": "semantic-release",
"webpack": "webpack"
"webpack": "webpack && cp package.json dist"
},

@@ -48,3 +48,6 @@ "bin": {

"logout": "./src/bin/logout.js",
"test:create": "./src/bin/test/create.js"
"test:create": "./src/bin/test/create.js",
"test:run": "./src/bin/test/run.js",
"whoami": "./src/bin/whoami.js",
"invite": "./src/bin/invite.js"
},

@@ -51,0 +54,0 @@ "keywords": [

@@ -1,1 +0,1 @@

exports.ids=[29,34,39,40],exports.modules={10:function(e,t){e.exports=require("path")},102:function(e,t){e.exports=require("crypto")},117:function(e){e.exports=JSON.parse('{"name":"node-command-line-starter-1","version":"2.0.7","author":"Himanshu @himanshu-dixit","repository":"crusherdev/CLI","main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"{src,__mocks__,bin}/**/*.ts":["prettier --write","git add"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"config":{"commitizen":{"path":"@commitlint/prompt"}},"scripts":{"build":"tsc","commit":"git-cz","format:check":"prettier --list-different \'{src,__mocks__,bin}/**/*.ts\'","format:write":"prettier --write \'{src,__mocks__,bin}/**/*.ts\'","start:help":"ts-node ./src/bin/order.ts -h","start:example":"ts-node ./src/bin/order.ts","test":"jest","bump-version":"rjp package.json version $VERSION","test:coverage":"jest --coverage","report:coverage":"npm run test:coverage && codecov","semantic-release":"semantic-release","webpack":"webpack"},"bin":{"init":"./src/bin/base.js","login":"./src/bin/login.js","logout":"./src/bin/logout.js","test:create":"./src/bin/test/create.js"},"keywords":["CLI","Replace","JSON","Buildtool","Starter"],"license":"MIT","dependencies":{"copy-webpack-plugin":"^10.2.4","glob":"^7.2.0"},"devDependencies":{"@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@commitlint/prompt":"^13.1.0","@semantic-release/changelog":"^5.0.1","@semantic-release/exec":"^5.0.0","@semantic-release/git":"^9.0.1","@types/jest":"^27.0.1","@types/node":"^16.9.4","axios":"^0.25.0","boxen":"^5.1.2","chalk":"^5.0.0","cli-ux":"^6.0.9","codecov":"^3.1.0","command-exists":"^1.2.9","commander":"^8.2.0","commitizen":"^4.2.4","fastify":"^3.27.1","husky":"^7.0.2","jest":"^27.2.0","jsonfile":"^6.1.0","lint-staged":"^11.1.2","localtunnel":"^2.0.2","prettier":"^2.4.1","replace-json-property":"^1.4.1","semantic-release":"^18.0.0","ts-jest":"^27.0.5","ts-loader":"^8.2.6","ts-node":"^10.2.1","typescript":"^4.4.3","webpack":"^4.2.0","webpack-cli":"^4.9.2"}}')},24:function(e,t){e.exports=require("url")},28:function(e,t){e.exports=require("events")},40:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUserInfo=t.setUserInfo=void 0;let n=null;t.setUserInfo=e=>{n=e};t.getUserInfo=()=>n},51:function(e,t){e.exports=require("child_process")},6:function(e,t){e.exports=require("fs")},75:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isCrusherConfigured=t.getAppConfig=t.setAppConfig=t.initializeAppConfig=void 0;const s=o(i(6)),c=i(32),a=i(40),l=i(33),p=o(i(10)),u=(0,l.resolvePathToAppDirectory)("crusher.json");t.initializeAppConfig=()=>{s.existsSync(c.APP_DIRECTORY)||(s.mkdirSync(c.APP_DIRECTORY),s.mkdirSync((0,l.resolvePathToAppDirectory)("bin"))),s.existsSync(p.resolve(c.APP_DIRECTORY,"crusher.json"))||(0,t.setAppConfig)({});const e=(0,t.getAppConfig)();(0,a.setUserInfo)(e.userInfo)};t.setAppConfig=e=>{s.writeFileSync(u,JSON.stringify(e))};t.getAppConfig=()=>(0,t.isCrusherConfigured)()?JSON.parse(s.readFileSync(u,"utf8")):null;t.isCrusherConfigured=()=>s.existsSync(u)},847:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=i(238),c=o(i(117)),a=i(75),l=new s.Command;l.addHelpText("after","\n Example call:\n $ custom-help --help"),l.parse(process.argv);new class{constructor(){const e=l.opts(),{help:t,version:i}=e;!0!==t?!0!==i?this.run():this.printVersion():this.help()}printVersion(){console.log(c.version)}help(){console.log("Logs user out from this machine")}run(){const e=(0,a.getAppConfig)();e.userInfo&&delete e.userInfo,(0,a.setAppConfig)(e),console.log("Logged out from this machine")}}}};
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=644)}({10:function(e,t){e.exports=require("crypto")},134:function(e,t,n){"use strict";n.r(t),n.d(t,"v1",(function(){return g})),n.d(t,"v3",(function(){return b})),n.d(t,"v4",(function(){return O})),n.d(t,"v5",(function(){return C})),n.d(t,"NIL",(function(){return A})),n.d(t,"version",(function(){return E})),n.d(t,"validate",(function(){return c})),n.d(t,"stringify",(function(){return u})),n.d(t,"parse",(function(){return _}));var r=n(10),i=n.n(r);const s=new Uint8Array(256);let o=s.length;function a(){return o>s.length-16&&(i.a.randomFillSync(s),o=0),s.slice(o,o+=16)}var l=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var c=function(e){return"string"==typeof e&&l.test(e)};const h=[];for(let e=0;e<256;++e)h.push((e+256).toString(16).substr(1));var u=function(e,t=0){const n=(h[e[t+0]]+h[e[t+1]]+h[e[t+2]]+h[e[t+3]]+"-"+h[e[t+4]]+h[e[t+5]]+"-"+h[e[t+6]]+h[e[t+7]]+"-"+h[e[t+8]]+h[e[t+9]]+"-"+h[e[t+10]]+h[e[t+11]]+h[e[t+12]]+h[e[t+13]]+h[e[t+14]]+h[e[t+15]]).toLowerCase();if(!c(n))throw TypeError("Stringified UUID is invalid");return n};let p,m,d=0,f=0;var g=function(e,t,n){let r=t&&n||0;const i=t||new Array(16);let s=(e=e||{}).node||p,o=void 0!==e.clockseq?e.clockseq:m;if(null==s||null==o){const t=e.random||(e.rng||a)();null==s&&(s=p=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==o&&(o=m=16383&(t[6]<<8|t[7]))}let l=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:f+1;const h=l-d+(c-f)/1e4;if(h<0&&void 0===e.clockseq&&(o=o+1&16383),(h<0||l>d)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=l,f=c,m=o,l+=122192928e5;const g=(1e4*(268435455&l)+c)%4294967296;i[r++]=g>>>24&255,i[r++]=g>>>16&255,i[r++]=g>>>8&255,i[r++]=255&g;const _=l/4294967296*1e4&268435455;i[r++]=_>>>8&255,i[r++]=255&_,i[r++]=_>>>24&15|16,i[r++]=_>>>16&255,i[r++]=o>>>8|128,i[r++]=255&o;for(let e=0;e<6;++e)i[r+e]=s[e];return t||u(i)};var _=function(e){if(!c(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};var v=function(e,t,n){function r(e,r,i,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=_(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),o=n(o),o[6]=15&o[6]|t,o[8]=63&o[8]|128,i){s=s||0;for(let e=0;e<16;++e)i[s+e]=o[e];return i}return u(o)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r};var b=v("v3",48,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),i.a.createHash("md5").update(e).digest()}));var O=function(e,t,n){const r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return u(r)};var C=v("v5",80,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),i.a.createHash("sha1").update(e).digest()})),A="00000000-0000-0000-0000-000000000000";var E=function(e){if(!c(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},18:function(e,t){e.exports=require("events")},2:function(e,t){e.exports=require("path")},20:function(e,t){class n extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=n,t.InvalidArgumentError=class extends n{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},25:function(e,t,n){const{InvalidArgumentError:r}=n(20);t.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e,this.parseArg=(t,n)=>{if(!e.includes(t))throw new r(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},26:function(e,t){e.exports=require("child_process")},27:function(e,t){e.exports=require("url")},3:function(e,t){e.exports=require("fs")},38:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecorderBuildForPlatfrom=t.RECORDER_LINUX_BUILd=t.RECORDER_MAC_BUILD=t.APP_DIRECTORY=t.FRONTEND_SERVER_URL=t.BACKEND_SERVER_URL=void 0;const o=s(n(2));t.BACKEND_SERVER_URL="https://backend.crusher.dev",t.FRONTEND_SERVER_URL="https://app.crusher.dev",t.APP_DIRECTORY=process.env.HOME+"/.crusher",t.RECORDER_MAC_BUILD="https://github.com/crusherdev/crusher-downloads/releases/download/v1.0.11/Crusher.Recorder-1.0.11-mac.zip",t.RECORDER_LINUX_BUILd="https://github.com/crusherdev/crusher-downloads/releases/download/v1.0.11/Crusher.Recorder-1.0.11-linux.zip";t.getRecorderBuildForPlatfrom=()=>{if("linux"===process.platform)return{url:t.RECORDER_LINUX_BUILd,name:o.basename(t.RECORDER_LINUX_BUILd),platform:"linux",version:t.RECORDER_LINUX_BUILd.split("/").reverse()[1]};if("darwin"===process.platform)return{url:t.RECORDER_MAC_BUILD,name:o.basename(t.RECORDER_MAC_BUILD),platform:"mac",version:t.RECORDER_MAC_BUILD.split("/").reverse()[1]};throw new Error("Recorder not available for your platfrom yet")}},39:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.resolvePathToAppDirectory=t.resolveFrontendServerUrl=t.resolveBackendServerUrl=t.createDirIfNotExist=t.extractRepoFullName=t.getGitBranchName=t.getLastCommitName=t.getGitLastCommitSHA=t.getGitRepos=t.isFromGithub=t.getFrontendServerUrl=t.getBackendServerUrl=t.getUniqueString=void 0;const o=n(134),a=n(38),l=n(26),c=s(n(3)),h=s(n(27)),u=s(n(2));t.getUniqueString=()=>(0,o.v1)();t.getBackendServerUrl=()=>a.BACKEND_SERVER_URL;t.getFrontendServerUrl=()=>a.FRONTEND_SERVER_URL;t.isFromGithub=()=>Boolean(process.env.GITHUB_ACTION);t.getGitRepos=()=>{const e=new RegExp(/(^\w+)\s+([\w.@:/?-]+)\s+\((fetch|push)\)/i);return new Promise((t,n)=>{(0,l.exec)("git remote -v",(function(r,i){if(r)return void n(r);const s=i.split("\n"),o={};if(s){for(const t of s){const n=t.match(e);if(n){const e=n[1],t=n[2],r=n[3];o[e]=Object.assign(Object.assign({},o[e]),{[r]:t})}}t(o)}else n(new Error("No remote origin found"))}))})};t.getGitLastCommitSHA=()=>new Promise((e,t)=>{const n=process.env.GITHUB_HEAD_REF?"git ls-remote origin "+process.env.GITHUB_HEAD_REF:"git rev-parse HEAD";(0,l.exec)(n,(function(n,r){if(n)return void t(n);const i=r.toString().split(/\s+/)[0].trim();e(i)}))});t.getLastCommitName=()=>new Promise((e,t)=>{(0,l.exec)("git log -1 --pretty=%B",(function(n,r){if(n)return void t(n);const i=r.toString().trim();e(i)}))});t.getGitBranchName=()=>new Promise((e,t)=>{new RegExp(/^refs\/heads\/(.+)/i);const n=process.env.GITHUB_HEAD_REF?process.env.GITHUB_HEAD_REF:null;n?e(n):(0,l.exec)("git for-each-ref --format='%(objectname) %(refname:short)' refs/heads | awk \"/^$(git rev-parse HEAD)/ {print \\$2}\"",(function(n,r){if(n)return void t(n);const i=r.toString().trim();e(i)}))});t.extractRepoFullName=e=>new Promise(t=>{const n=new RegExp(/^(?:https|git)(?::\/\/|@)(?:[^/:]+)[/:]([^/:]+)\/(.+)/i),r=e.match(n);if(r&&3===r.length){const e=r[2].trim(),n=e.length>4&&".git"===e.slice(-4)?e.slice(0,-4):e;t(r[1].trim()+"/"+n.trim())}else t("")});t.createDirIfNotExist=e=>{c.existsSync(e)||c.mkdirSync(e)};t.resolveBackendServerUrl=e=>h.resolve(a.BACKEND_SERVER_URL,e);t.resolveFrontendServerUrl=e=>h.resolve(a.FRONTEND_SERVER_URL,e);t.resolvePathToAppDirectory=e=>u.resolve(a.APP_DIRECTORY,e)},43:function(e,t,n){const{humanReadableArgName:r}=n(25);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden);if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(n).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let i;i=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}if(this.sortOptions){const e=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");t.sort((t,n)=>e(t).localeCompare(e(n)))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e._args.find(e=>e.description)?e._args:[]}subcommandTerm(e){const t=e._args.map(e=>r(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){const t=[];return e.argChoices&&!e.negate&&t.push("choices: "+e.argChoices.map(e=>JSON.stringify(e)).join(", ")),void 0===e.defaultValue||e.negate||t.push("default: "+(e.defaultValueDescription||JSON.stringify(e.defaultValue))),void 0!==e.envVar&&t.push("env: "+e.envVar),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push("choices: "+e.argChoices.map(e=>JSON.stringify(e)).join(", ")),void 0!==e.defaultValue&&t.push("default: "+(e.defaultValueDescription||JSON.stringify(e.defaultValue))),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){const s=`${e.padEnd(n+2)}${i}`;return t.wrap(s,r-2,n+2)}return e}function s(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let o=["Usage: "+t.commandUsage(e),""];const a=t.commandDescription(e);a.length>0&&(o=o.concat([a,""]));const l=t.visibleArguments(e).map(e=>i(t.argumentTerm(e),t.argumentDescription(e)));l.length>0&&(o=o.concat(["Arguments:",s(l),""]));const c=t.visibleOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));c.length>0&&(o=o.concat(["Options:",s(c),""]));const h=t.visibleCommands(e).map(e=>i(t.subcommandTerm(e),t.subcommandDescription(e)));return h.length>0&&(o=o.concat(["Commands:",s(h),""])),o.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){if(e.match(/[\n]\s+/))return e;const i=t-n;if(i<r)return e;const s=e.substr(0,n),o=e.substr(n),a=" ".repeat(n),l=new RegExp(".{1,"+(i-1)+"}([\\sā€‹]|$)|[^\\sā€‹]+?([\\sā€‹]|$)","g");return s+(o.match(l)||[]).map((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?a:"")+e.trimRight())).join("\n")}}},44:function(e,t,n){const{InvalidArgumentError:r}=n(20);function i(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}t.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=i(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e,this.parseArg=(t,n)=>{if(!e.includes(t))throw new r(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}is(e){return this.short===e||this.long===e}},t.splitOptionFlags=i},57:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUserInfo=t.setUserInfo=void 0;let r=null;t.setUserInfo=e=>{r=e};t.getUserInfo=()=>r},644:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o=n(88),a=s(n(91)),l=n(80),c=new o.Command;c.addHelpText("after","\n Example call:\n $ custom-help --help"),c.parse(process.argv);new class{constructor(){const e=c.opts(),{help:t,version:n}=e;!0!==t?!0!==n?this.run():this.printVersion():this.help()}printVersion(){console.log(a.version)}help(){console.log("Logs user out from this machine")}run(){const e=(0,l.getAppConfig)();e.userInfo&&delete e.userInfo,(0,l.setAppConfig)(e),console.log("Logged out from this machine")}}},80:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isCrusherConfigured=t.getAppConfig=t.setAppConfig=t.initializeAppConfig=void 0;const o=s(n(3)),a=n(38),l=n(57),c=n(39),h=s(n(2)),u=(0,c.resolvePathToAppDirectory)("crusher.json");t.initializeAppConfig=()=>{o.existsSync(a.APP_DIRECTORY)||(o.mkdirSync(a.APP_DIRECTORY),o.mkdirSync((0,c.resolvePathToAppDirectory)("bin"))),o.existsSync(h.resolve(a.APP_DIRECTORY,"crusher.json"))||(0,t.setAppConfig)({});const e=(0,t.getAppConfig)();(0,l.setUserInfo)(e.userInfo)};t.setAppConfig=e=>{o.writeFileSync(u,JSON.stringify(e))};t.getAppConfig=()=>(0,t.isCrusherConfigured)()?JSON.parse(o.readFileSync(u,"utf8")):null;t.isCrusherConfigured=()=>o.existsSync(u)},88:function(e,t,n){const{Argument:r}=n(25),{Command:i}=n(89),{CommanderError:s,InvalidArgumentError:o}=n(20),{Help:a}=n(43),{Option:l}=n(44);(t=e.exports=new i).program=t,t.Argument=r,t.Command=i,t.CommanderError=s,t.Help=a,t.InvalidArgumentError=o,t.InvalidOptionArgumentError=o,t.Option=l},89:function(e,t,n){const r=n(18).EventEmitter,i=n(26),s=n(2),o=n(3),{Argument:a,humanReadableArgName:l}=n(25),{CommanderError:c}=n(20),{Help:h}=n(43),{Option:u,splitOptionFlags:p}=n(44),{suggestSimilar:m}=n(90);class d extends r{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!1,this._outputConfiguration={writeOut:e=>process.stdout.write(e),writeErr:e=>process.stderr.write(e),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:void 0,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,n){let r=t,i=n;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};const[,s,o]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(s);return r&&(a.description(r),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!i.noHelp&&!i.hidden),a._executableFile=i.executableFile||null,o&&a.arguments(o),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new d(e)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");return function e(t){t.forEach(t=>{if(t._executableHandler&&!t._executableFile)throw new Error("Must specify executableFile for deeply nested executable: "+t.name());e(t.commands)})}(e.commands),(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new a(e,t)}argument(e,t,n,r){const i=this.createArgument(e,t);return"function"==typeof n?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),process.exit(e)}action(e){return this._actionHandler=t=>{const n=this._args.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new u(e,t)}addOption(e){const t=e.name(),n=e.attributeName();let r=e.defaultValue;if(e.negate||e.optional||e.required||"boolean"==typeof r){if(e.negate){const t=e.long.replace(/^--no-/,"--");r=!this._findOption(t)||this.getOptionValue(n)}void 0!==r&&this.setOptionValueWithSource(n,r,"default")}this.options.push(e);const i=(t,i,s)=>{const o=this.getOptionValue(n);if(null!==t&&e.parseArg)try{t=e.parseArg(t,void 0===o?r:o)}catch(e){if("commander.invalidArgument"===e.code){const t=`${i} ${e.message}`;this._displayError(e.exitCode,e.code,t)}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,o));"boolean"==typeof o||void 0===o?null==t?this.setOptionValueWithSource(n,!e.negate&&(r||!0),s):this.setOptionValueWithSource(n,t,s):null!==t&&this.setOptionValueWithSource(n,!e.negate&&t,s)};return this.on("option:"+t,t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;i(t,n,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;i(t,n,"env")}),this}_optionEx(e,t,n,r,i){const s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),"function"==typeof r)s.default(i).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},s.default(i).argParser(r)}else s.default(r);return this.addOption(s)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this}setOptionValueWithSource(e,t,n){return this.setOptionValue(e,t),this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let r;switch(t=t||{},void 0===e&&(e=process.argv,process.versions&&process.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._scriptPath&&n.c[n.s]&&(this._scriptPath=n.c[n.s].filename),this._name=this._name||this._scriptPath&&s.basename(this._scriptPath,s.extname(this._scriptPath)),r}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let r=!1;const a=[".js",".ts",".tsx",".mjs",".cjs"];this._checkForMissingMandatoryOptions();let l,h=this._scriptPath;!h&&n.c[n.s]&&(h=n.c[n.s].filename);try{const e=o.realpathSync(h);l=s.dirname(e)}catch(e){l="."}let u=s.basename(h,s.extname(h))+"-"+e._name;e._executableFile&&(u=e._executableFile);const p=s.join(l,u);let m;o.existsSync(p)?u=p:a.forEach(e=>{o.existsSync(`${p}${e}`)&&(u=`${p}${e}`)}),r=a.includes(s.extname(u)),"win32"!==process.platform?r?(t.unshift(u),t=g(process.execArgv).concat(t),m=i.spawn(process.argv[0],t,{stdio:"inherit"})):m=i.spawn(u,t,{stdio:"inherit"}):(t.unshift(u),t=g(process.execArgv).concat(t),m=i.spawn(process.execPath,t,{stdio:"inherit"}));["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{process.on(e,()=>{!1===m.killed&&null===m.exitCode&&m.kill(e)})});const d=this._exitCallback;d?m.on("close",()=>{d(new c(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):m.on("close",process.exit.bind(process)),m.on("error",t=>{if("ENOENT"===t.code){const t=`'${u}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name`;throw new Error(t)}if("EACCES"===t.code)throw new Error(`'${u}' not executable`);if(d){const e=new c(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,d(e)}else process.exit(1)}),this.runningCommand=m}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);if(r||this.help({error:!0}),!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))}_checkNumberOfArguments(){this._args.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${n.message}`;this._displayError(n.exitCode,n.code,r)}throw n}return r};this._checkNumberOfArguments();const t=[];this._args.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return _(this).reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),"postAction"===t&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return f(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),f(this,n.unknown),this._checkForMissingMandatoryOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i="command:"+this.name();if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&this.parent.emit(i,e,t),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})}parseOptions(e){const t=[],n=[];let r=t;const i=e.slice();function s(e){return e.length>1&&"-"===e[0]}let o=null;for(;i.length;){const e=i.shift();if("--"===e){r===n&&r.push(e),r.push(...i);break}if(!o||s(e)){if(o=null,s(e)){const t=this._findOption(e);if(t){if(t.required){const e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit("option:"+t.name(),e)}else if(t.optional){let e=null;i.length>0&&!s(i[0])&&(e=i.shift()),this.emit("option:"+t.name(),e)}else this.emit("option:"+t.name());o=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption("-"+e[1]);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit("option:"+t.name(),e.slice(2)):(this.emit("option:"+t.name()),i.unshift("-"+e.slice(2)));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit("option:"+n.name(),e.slice(t+1));continue}}if(s(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}else this.emit("option:"+o.name(),e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}_displayError(e,t,n){this._outputConfiguration.outputError(n+"\n",this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(this._showHelpAfterError+"\n"):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0})),this._exit(e,t,n)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in process.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit("optionEnv:"+e.name(),process.env[e.envVar]):this.emit("optionEnv:"+e.name()))}})}missingArgument(e){const t=`error: missing required argument '${e}'`;this._displayError(1,"commander.missingArgument",t)}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this._displayError(1,"commander.optionMissingArgument",t)}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this._displayError(1,"commander.missingMandatoryOptionValue",t)}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}const n=`error: unknown option '${e}'${t}`;this._displayError(1,"commander.unknownOption",n)}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this._displayError(1,"commander.excessArguments",r)}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}const n=`error: unknown command '${e}'${t}`;this._displayError(1,"commander.unknownCommand",n)}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(e+"\n"),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map(e=>l(e));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);_(this).reverse().forEach(e=>e.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),_(this).forEach(e=>e.emit("afterAllHelp",n))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=p(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=process.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=e+"Help";return this.on(r,e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(n+"\n")}),this}}function f(e,t){e._hasHelpOption&&t.find(t=>t===e._helpLongFlag||t===e._helpShortFlag)&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function g(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",i="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],i=n[4]),t&&"0"!==i?`${t}=${r}:${parseInt(i)+1}`:e})}function _(e){const t=[];for(let n=e;n;n=n.parent)t.push(n);return t}t.Command=d},90:function(e,t){t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return t.forEach(t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let s=1;s=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+s),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}(e,t),s=Math.max(e.length,t.length);(s-n)/s>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>"--"+e)),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""}},91:function(e){e.exports=JSON.parse('{"name":"node-command-line-starter-1","version":"2.1.5","author":"Himanshu @himanshu-dixit","repository":"crusherdev/CLI","main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"{src,__mocks__,bin}/**/*.ts":["prettier --write","git add"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"config":{"commitizen":{"path":"@commitlint/prompt"}},"scripts":{"build":"tsc","commit":"git-cz","format:check":"prettier --list-different \'{src,__mocks__,bin}/**/*.ts\'","format:write":"prettier --write \'{src,__mocks__,bin}/**/*.ts\'","start:help":"ts-node ./src/bin/order.ts -h","start:example":"ts-node ./src/bin/order.ts","test":"jest","bump-version":"rjp package.json version $VERSION","test:coverage":"jest --coverage","report:coverage":"npm run test:coverage && codecov","semantic-release":"semantic-release","webpack":"webpack && cp package.json dist"},"bin":{"init":"./src/bin/base.js","login":"./src/bin/login.js","logout":"./src/bin/logout.js","test:create":"./src/bin/test/create.js","test:run":"./src/bin/test/run.js","whoami":"./src/bin/whoami.js","invite":"./src/bin/invite.js"},"keywords":["CLI","Replace","JSON","Buildtool","Starter"],"license":"MIT","dependencies":{},"devDependencies":{"copy-webpack-plugin":"^10.2.4","glob":"^7.2.0","@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@commitlint/prompt":"^13.1.0","@semantic-release/changelog":"^5.0.1","@semantic-release/exec":"^5.0.0","@semantic-release/git":"^9.0.1","@types/jest":"^27.0.1","@types/node":"^16.9.4","axios":"^0.25.0","boxen":"^5.1.2","chalk":"^5.0.0","cli-ux":"^6.0.9","codecov":"^3.1.0","command-exists":"^1.2.9","commander":"^8.2.0","commitizen":"^4.2.4","fastify":"^3.27.1","husky":"^7.0.2","jest":"^27.2.0","jsonfile":"^6.1.0","lint-staged":"^11.1.2","localtunnel":"^2.0.2","prettier":"^2.4.1","replace-json-property":"^1.4.1","semantic-release":"^18.0.0","ts-jest":"^27.0.5","ts-loader":"^8.2.6","ts-node":"^10.2.1","typescript":"^4.4.3","webpack":"^4.2.0","webpack-cli":"^4.9.2"}}')}});

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc