@stats-cc/cli 0.0.0 → 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 stats.cc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @stats-cc/cli
2
+
3
+ The `stats` command line for the [stats.cc](https://stats.cc) Rainbow Six Siege API, as a prebuilt binary.
4
+
5
+ ```sh
6
+ npm install --global @stats-cc/cli
7
+ stats login
8
+ stats profiles get Nordwind --platform pc
9
+ ```
10
+
11
+ npm installs the binary for your platform from one of the `@stats-cc/cli-<platform>` packages: Linux x64 and arm64,
12
+ macOS x64 and arm64, and Windows x64. On any other platform, build it with `cargo install statscc-cli`.
13
+
14
+ Every command is in the [CLI's README](https://github.com/stats-cc/sdk/tree/main/cli#readme).
15
+
16
+ ## License
17
+
18
+ MIT
package/bin/stats.js ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ // @ts-check
3
+ // Runs the `stats` binary from the platform package npm installed next to this one, passing the arguments, the
4
+ // standard streams and the exit status through
5
+
6
+ import { spawnSync } from "node:child_process";
7
+ import { createRequire } from "node:module";
8
+
9
+ const platform = `${process.platform}-${process.arch}`;
10
+ const binary = process.platform === "win32" ? "stats.exe" : "stats";
11
+ const path = resolveBinary(`@stats-cc/cli-${platform}/bin/${binary}`);
12
+
13
+ const result = spawnSync(path, process.argv.slice(2), { stdio: "inherit" });
14
+
15
+ if (result.error) {
16
+ console.error(`stats: could not run ${path}: ${result.error.message}`);
17
+ process.exit(1);
18
+ }
19
+
20
+ if (result.signal) {
21
+ process.kill(process.pid, result.signal);
22
+ }
23
+
24
+ process.exit(result.status ?? 1);
25
+
26
+ /** The installed binary's path, or an exit with what to do when npm skipped the platform package */
27
+ function resolveBinary(specifier) {
28
+ try {
29
+ return createRequire(import.meta.url).resolve(specifier);
30
+ } catch {
31
+ console.error(
32
+ `stats: no prebuilt binary for ${platform}. Reinstall without --no-optional or --omit=optional, or build it ` +
33
+ "with `cargo install statscc-cli`",
34
+ );
35
+
36
+ process.exit(1);
37
+ }
38
+ }
package/package.json CHANGED
@@ -1 +1,39 @@
1
- {"name":"@stats-cc/cli","version":"0.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/stats-cc/sdk.git"}}
1
+ {
2
+ "name": "@stats-cc/cli",
3
+ "version": "0.1.0",
4
+ "description": "The stats command line for the stats.cc Rainbow Six Siege API",
5
+ "keywords": [
6
+ "cli",
7
+ "r6",
8
+ "rainbow six siege",
9
+ "stats.cc",
10
+ "webhooks"
11
+ ],
12
+ "homepage": "https://github.com/stats-cc/sdk/tree/main/cli#readme",
13
+ "bugs": "https://github.com/stats-cc/sdk/issues",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/stats-cc/sdk.git",
18
+ "directory": "cli/npm"
19
+ },
20
+ "bin": {
21
+ "stats": "bin/stats.js"
22
+ },
23
+ "files": [
24
+ "bin",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "type": "module",
29
+ "optionalDependencies": {
30
+ "@stats-cc/cli-darwin-arm64": "0.1.0",
31
+ "@stats-cc/cli-darwin-x64": "0.1.0",
32
+ "@stats-cc/cli-linux-arm64": "0.1.0",
33
+ "@stats-cc/cli-linux-x64": "0.1.0",
34
+ "@stats-cc/cli-win32-x64": "0.1.0"
35
+ },
36
+ "engines": {
37
+ "node": ">=18"
38
+ }
39
+ }