private-connect 0.3.4 → 0.3.5

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 (2) hide show
  1. package/dist/index.js +22 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31,6 +31,26 @@ const c = {
31
31
  const ok = `${c.green}✓${c.reset}`;
32
32
  const fail = `${c.red}✗${c.reset}`;
33
33
  const warn = `${c.yellow}⚠${c.reset}`;
34
+ // Track usage (fire and forget, don't block)
35
+ function trackUsage(command) {
36
+ const data = JSON.stringify({
37
+ os: process.platform,
38
+ arch: process.arch === 'arm64' ? 'arm64' : 'x64',
39
+ version: 'npx',
40
+ source: 'npx',
41
+ });
42
+ const req = https.request('https://api.privateconnect.co/v1/events/install', {
43
+ method: 'POST',
44
+ headers: {
45
+ 'Content-Type': 'application/json',
46
+ 'Content-Length': Buffer.byteLength(data),
47
+ },
48
+ timeout: 3000,
49
+ });
50
+ req.on('error', () => { }); // Silently ignore errors
51
+ req.write(data);
52
+ req.end();
53
+ }
34
54
  async function testTcp(host, port, timeout = 5000) {
35
55
  return new Promise((resolve) => {
36
56
  const start = Date.now();
@@ -511,6 +531,8 @@ if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
511
531
  printHelp();
512
532
  process.exit(0);
513
533
  }
534
+ // Track usage (non-blocking)
535
+ trackUsage(args[0] || 'help');
514
536
  if (args[0] === 'test' || args[0] === 'check') {
515
537
  if (!args[1]) {
516
538
  console.error(`${c.red}Error: Target required${c.reset}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "private-connect",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Test connectivity to any service. No signup required.",
5
5
  "bin": {
6
6
  "private-connect": "./dist/index.js"