nid2-cli 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm-increaser-downloads.config.d.ts","sourceRoot":"","sources":["../npm-increaser-downloads.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"npm-increaser-downloads.config.d.ts","sourceRoot":"","sources":["../npm-increaser-downloads.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,QAAA,MAAM,MAAM,EAAE,MAiBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const config = {
|
|
4
4
|
// NPM package to increase the download count for
|
|
5
5
|
packageName: "",
|
|
6
|
+
// Version to increase the downloads of (optional)
|
|
7
|
+
packageVersion: undefined,
|
|
6
8
|
// Number of downloads to add to the package
|
|
7
9
|
numDownloads: 1000,
|
|
8
10
|
// Amount of downloads you can run in parallel at once.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm-increaser-downloads.config.js","sourceRoot":"","sources":["../npm-increaser-downloads.config.ts"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAW;IACrB,iDAAiD;IACjD,WAAW,EAAE,EAAE;IAEf,4CAA4C;IAC5C,YAAY,EAAE,IAAI;IAElB,uDAAuD;IACvD,yEAAyE;IACzE,sBAAsB,EAAE,GAAG;IAE3B,kDAAkD;IAClD,mEAAmE;IACnE,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"npm-increaser-downloads.config.js","sourceRoot":"","sources":["../npm-increaser-downloads.config.ts"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAW;IACrB,iDAAiD;IACjD,WAAW,EAAE,EAAE;IAEf,kDAAkD;IAClD,cAAc,EAAE,SAAS;IAEzB,4CAA4C;IAC5C,YAAY,EAAE,IAAI;IAElB,uDAAuD;IACvD,yEAAyE;IACzE,sBAAsB,EAAE,GAAG;IAE3B,kDAAkD;IAClD,mEAAmE;IACnE,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
package/lib/src/cli.js
CHANGED
|
@@ -6,9 +6,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const yargs_1 = __importDefault(require("yargs"));
|
|
8
8
|
const helpers_1 = require("yargs/helpers");
|
|
9
|
-
const prompts_1 = require("./cli/prompts");
|
|
10
9
|
const config_1 = require("./config");
|
|
11
10
|
const spammer_1 = require("./spammer/spammer");
|
|
11
|
+
const npm_increaser_downloads_config_1 = __importDefault(require("../npm-increaser-downloads.config"));
|
|
12
12
|
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
13
13
|
.usage("Usage: nid [options]\n\n" +
|
|
14
14
|
"Note: if no options are provided, nid will prompt for input interactively.\n\n" +
|
|
@@ -24,6 +24,8 @@ const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
|
24
24
|
alias: "p",
|
|
25
25
|
type: "string",
|
|
26
26
|
description: "NPM package to increase the downloads of",
|
|
27
|
+
demandOption: true,
|
|
28
|
+
requiresArg: true,
|
|
27
29
|
})
|
|
28
30
|
.option("package-version", {
|
|
29
31
|
alias: "v",
|
|
@@ -49,43 +51,20 @@ const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
|
49
51
|
.alias("help", "h")
|
|
50
52
|
.epilogue("For more information, visit https://github.com/MinhOmega/npm-increaser-downloads").argv;
|
|
51
53
|
const runWithArgs = (args) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(0, prompts_1.getConfigFromCli)().then(config_1.setConfig).then(spammer_1.run);
|
|
57
|
-
return;
|
|
54
|
+
if (!args["package-name"]) {
|
|
55
|
+
console.log("Error: --package-name (-p) is required.");
|
|
56
|
+
yargs_1.default.showHelp();
|
|
57
|
+
process.exit(1);
|
|
58
58
|
}
|
|
59
59
|
const config = {
|
|
60
60
|
packageName: args["package-name"],
|
|
61
|
-
packageVersion: args["package-version"],
|
|
62
|
-
numDownloads: args["num-downloads"],
|
|
63
|
-
maxConcurrentDownloads: args["max-concurrent-downloads"],
|
|
64
|
-
downloadTimeout: args["download-timeout"],
|
|
61
|
+
packageVersion: args["package-version"] ?? undefined,
|
|
62
|
+
numDownloads: args["num-downloads"] ?? npm_increaser_downloads_config_1.default.numDownloads,
|
|
63
|
+
maxConcurrentDownloads: args["max-concurrent-downloads"] ?? npm_increaser_downloads_config_1.default.maxConcurrentDownloads,
|
|
64
|
+
downloadTimeout: args["download-timeout"] ?? npm_increaser_downloads_config_1.default.downloadTimeout,
|
|
65
65
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
packageName: config.packageName,
|
|
69
|
-
packageVersion: "latest",
|
|
70
|
-
numDownloads: 100,
|
|
71
|
-
maxConcurrentDownloads: 10,
|
|
72
|
-
downloadTimeout: 5000,
|
|
73
|
-
};
|
|
74
|
-
(0, config_1.setConfig)(defaultConfig);
|
|
75
|
-
(0, spammer_1.run)();
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const isConfigComplete = Object.values(config).every((value) => value !== undefined);
|
|
79
|
-
if (isConfigComplete) {
|
|
80
|
-
(0, config_1.setConfig)(config);
|
|
81
|
-
(0, spammer_1.run)();
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
// If any argument was provided but config is incomplete, show help and exit
|
|
85
|
-
console.log("Incomplete configuration. Please provide all required options or run without arguments for interactive mode.");
|
|
86
|
-
yargs_1.default.showHelp();
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
66
|
+
(0, config_1.setConfig)(config);
|
|
67
|
+
(0, spammer_1.run)();
|
|
89
68
|
};
|
|
90
69
|
runWithArgs(argv);
|
|
91
70
|
//# sourceMappingURL=cli.js.map
|
package/lib/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,kDAAyC;AACzC,2CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,kDAAyC;AACzC,2CAAwC;AACxC,qCAAqC;AAErC,+CAAwC;AACxC,uGAA8D;AAE9D,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACtC,KAAK,CACJ,0BAA0B;IACxB,gFAAgF;IAChF,4FAA4F;IAC5F,sFAAsF;IACtF,eAAe;IACf,WAAW;IACX,gDAAgD;IAChD,yDAAyD;IACzD,mHAAmH;IACnH,4CAA4C,CAC/C;KACA,MAAM,CAAC,cAAc,EAAE;IACtB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,0CAA0C;IACvD,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;CAClB,CAAC;KACD,MAAM,CAAC,iBAAiB,EAAE;IACzB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sCAAsC;CACpD,CAAC;KACD,MAAM,CAAC,eAAe,EAAE;IACvB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,yCAAyC;CACvD,CAAC;KACD,MAAM,CAAC,0BAA0B,EAAE;IAClC,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,E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