@perfscale/exe 0.0.3 → 0.5.0

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.
Files changed (3) hide show
  1. package/README.md +18 -0
  2. package/bin/perfscale.js +49 -0
  3. package/package.json +23 -13
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @perfscale/exe
2
+
3
+ [perfscale](https://github.com/Perfscale/perfscale) — a load-testing CLI that runs k6 scripts, Locust files,
4
+ and native YAML tests — distributed as a standalone binary via npm.
5
+
6
+ ```sh
7
+ npm install -g @perfscale/exe
8
+ perfscale --help
9
+ ```
10
+
11
+ npm installs only the binary matching your platform (via
12
+ optionalDependencies). Supported: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64, win32-arm64.
13
+ Linux binaries are static (musl) and run on any distribution.
14
+
15
+ - Docs: https://perfscale.su/docs/oss
16
+ - MCP server for AI agents: [`@perfscale/mcp`](https://www.npmjs.com/package/@perfscale/mcp)
17
+ (expects this binary on PATH)
18
+ - Other install methods (curl, Homebrew, cargo): https://github.com/Perfscale/perfscale#installation
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ // Thin launcher: resolves the platform package installed via
4
+ // optionalDependencies and execs the native perfscale binary.
5
+ const { spawnSync } = require("child_process");
6
+
7
+ const PLATFORM_PACKAGES = {
8
+ "linux x64": "@perfscale/linux-x64",
9
+ "linux arm64": "@perfscale/linux-arm64",
10
+ "darwin x64": "@perfscale/darwin-x64",
11
+ "darwin arm64": "@perfscale/darwin-arm64",
12
+ "win32 x64": "@perfscale/win32-x64",
13
+ "win32 arm64": "@perfscale/win32-arm64",
14
+ };
15
+
16
+ const key = process.platform + " " + process.arch;
17
+ const pkg = PLATFORM_PACKAGES[key];
18
+ if (!pkg) {
19
+ console.error(
20
+ "@perfscale/exe: unsupported platform " + key + ".\n" +
21
+ "Prebuilt binaries: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64, win32-arm64.\n" +
22
+ "Build from source instead: https://github.com/Perfscale/perfscale"
23
+ );
24
+ process.exit(1);
25
+ }
26
+
27
+ const binName = process.platform === "win32" ? "perfscale.exe" : "perfscale";
28
+ let bin;
29
+ try {
30
+ bin = require.resolve(pkg + "/bin/" + binName);
31
+ } catch {
32
+ console.error(
33
+ "@perfscale/exe: platform package " + pkg + " is not installed.\n" +
34
+ "This usually means optional dependencies were skipped " +
35
+ "(npm install --no-optional) or the package cache is corrupted.\n" +
36
+ "Fix: reinstall with optional dependencies enabled: npm i -g @perfscale/exe"
37
+ );
38
+ process.exit(1);
39
+ }
40
+
41
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
42
+ if (result.error) {
43
+ console.error("@perfscale/exe: failed to run " + bin + ": " + result.error.message);
44
+ process.exit(1);
45
+ }
46
+ if (result.signal) {
47
+ process.kill(process.pid, result.signal);
48
+ }
49
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,22 +1,32 @@
1
1
  {
2
2
  "name": "@perfscale/exe",
3
- "version": "0.0.3",
4
- "scripts": {
5
- "npm:publish": "bun publish --access=public"
3
+ "description": "perfscale — load testing CLI (k6, Locust, and a native engine) as a standalone binary, installed via npm.",
4
+ "version": "0.5.0",
5
+ "license": "MIT OR Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Perfscale/perfscale.git"
9
+ },
10
+ "homepage": "https://github.com/Perfscale/perfscale#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/Perfscale/perfscale/issues"
6
13
  },
7
14
  "keywords": [
8
- "performance",
9
15
  "perfscale",
10
- "load",
11
- "loadtesting"
16
+ "load-testing",
17
+ "performance",
18
+ "k6",
19
+ "locust"
12
20
  ],
13
- "author": "Vitali Haradkou <vitalicset@yandex.ru>",
14
- "license": "MIT",
21
+ "bin": {
22
+ "perfscale": "bin/perfscale.js"
23
+ },
15
24
  "optionalDependencies": {
16
- "@perfscale/darwin-arm64": "0.0.2",
17
- "@perfscale/darwin-x64": "0.0.2",
18
- "@perfscale/linux-arm64": "0.0.2",
19
- "@perfscale/linux-x64": "0.0.2",
20
- "@perfscale/win-x64": "0.0.2"
25
+ "@perfscale/linux-x64": "0.5.0",
26
+ "@perfscale/linux-arm64": "0.5.0",
27
+ "@perfscale/darwin-x64": "0.5.0",
28
+ "@perfscale/darwin-arm64": "0.5.0",
29
+ "@perfscale/win32-x64": "0.5.0",
30
+ "@perfscale/win32-arm64": "0.5.0"
21
31
  }
22
32
  }