nid2-cli 1.1.0 โ†’ 1.1.2

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.
package/README.md CHANGED
@@ -56,13 +56,13 @@ nid2 [options]
56
56
 
57
57
  ### ๐Ÿ“‹ Available Options
58
58
 
59
- | Option | Short | Type | Description |
60
- | ---------------------------- | ----- | -------- | ----------------------------------------------------- |
61
- | `--package-name` | `-p` | `string` | NPM package name to simulate downloads for |
62
- | `--package-version` | `-v` | `string` | Package version (defaults to latest if not specified) |
63
- | `--num-downloads` | `-n` | `number` | Total number of downloads to simulate |
64
- | `--max-concurrent-downloads` | `-m` | `number` | Maximum concurrent downloads at once |
65
- | `--download-timeout` | `-t` | `number` | Download timeout in milliseconds |
59
+ | Option | Short | Type | Required | Description |
60
+ | :-- | --- | --- | --- | :-- |
61
+ | `--package-name` | `-p` | `string` | `true` | NPM package name to simulate downloads for |
62
+ | `--package-version` | `-v` | `string` | `false` | Package version (defaults to latest if not specified) |
63
+ | `--num-downloads` | `-n` | `number` | `false` | Total number of downloads to simulate |
64
+ | `--max-concurrent-downloads` | `-m` | `number` | `false` | Maximum concurrent downloads at once |
65
+ | `--download-timeout` | `-t` | `number` | `false` | Download timeout in milliseconds |
66
66
 
67
67
  ### ๐Ÿ“ Usage Examples
68
68
 
@@ -114,14 +114,14 @@ npm install
114
114
 
115
115
  ### ๐Ÿงช Available Scripts
116
116
 
117
- | Script | Description |
118
- | ----------------- | ---------------------------------------------- |
119
- | `npm run dev` | Run in development mode with file watching |
117
+ | Script | Description |
118
+ | :-- | --- |
119
+ | `npm run dev` | Run in development mode with file watching |
120
120
  | `npm run dev:cli` | Run CLI in development mode with file watching |
121
- | `npm run build` | Compile TypeScript to JavaScript |
122
- | `npm start` | Run compiled JavaScript |
123
- | `npm test` | Run test suite with coverage |
124
- | `npm run format` | Format code and fix linting issues |
121
+ | `npm run build` | Compile TypeScript to JavaScript |
122
+ | `npm start` | Run compiled JavaScript |
123
+ | `npm test` | Run test suite with coverage |
124
+ | `npm run format` | Format code and fix linting issues |
125
125
 
126
126
  ## โš™๏ธ Configuration
127
127
 
@@ -143,13 +143,13 @@ export default config;
143
143
 
144
144
  ### Configuration Options
145
145
 
146
- | Property | Type | Description | Example |
147
- | ------------------------ | ------------------- | ------------------------------------- | ----------- |
148
- | `packageName` | `string` | NPM package to simulate downloads for | `"lodash"` |
149
- | `packageVersion` | `string` (optional) | Specific package version | `"4.17.21"` |
150
- | `numDownloads` | `number` | Total downloads to simulate | `1000` |
151
- | `maxConcurrentDownloads` | `number` | Parallel downloads at once | `300` |
152
- | `downloadTimeout` | `number` | Timeout per download (ms) | `3000` |
146
+ | Property | Type | Description | Example |
147
+ | :-- | --- | :-- | --- |
148
+ | `packageName` | `string` | NPM package to simulate downloads for | `"lodash"` |
149
+ | `packageVersion` | `string` (optional) | Specific package version | `"4.17.21"` |
150
+ | `numDownloads` | `number` | Total downloads to simulate | `1000` |
151
+ | `maxConcurrentDownloads` | `number` | Parallel downloads at once | `300` |
152
+ | `downloadTimeout` | `number` | Timeout per download (ms) | `3000` |
153
153
 
154
154
  ### โšก Performance Tuning
155
155
 
@@ -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,MAcb,CAAC;AAEF,eAAe,MAAM,CAAC"}
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
- // Check if any relevant argument was provided
53
- const hasAnyArg = ["package-name", "package-version", "num-downloads", "max-concurrent-downloads", "download-timeout"].some((arg) => args[arg] !== undefined);
54
- if (!hasAnyArg) {
55
- // If no relevant arguments were provided, fall back to CLI prompts
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
- if (config.packageName && !config.packageVersion && !config.numDownloads && !config.maxConcurrentDownloads && !config.downloadTimeout) {
67
- const defaultConfig = {
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
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,kDAAyC;AACzC,2CAAwC;AACxC,2CAAiD;AACjD,qCAAqC;AAErC,+CAAwC;AAExC,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;CACxD,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,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
1
1
  {
2
2
  "name": "nid2-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Raises the popularity score on your package through nefarious means.",
5
5
  "author": "otoneko.",
6
6
  "license": "MIT",