@push.rocks/smartnetwork 4.0.1 → 4.0.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.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartnetwork',
6
- version: '4.0.1',
6
+ version: '4.0.2',
7
7
  description: 'A toolkit for network diagnostics including speed tests, port availability checks, and more.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSwwQkFBMEI7SUFDaEMsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLDhGQUE4RjtDQUM1RyxDQUFBIn0=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartnetwork",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "private": false,
5
5
  "description": "A toolkit for network diagnostics including speed tests, port availability checks, and more.",
6
6
  "main": "dist_ts/index.js",
@@ -9,12 +9,11 @@
9
9
  "author": "Lossless GmbH",
10
10
  "license": "MIT",
11
11
  "devDependencies": {
12
- "@git.zone/tsbuild": "^2.1.61",
12
+ "@git.zone/tsbuild": "^2.5.1",
13
13
  "@git.zone/tsrun": "^1.2.39",
14
- "@git.zone/tstest": "^1.0.69",
14
+ "@git.zone/tstest": "^1.9.0",
15
15
  "@push.rocks/smartenv": "^5.0.0",
16
- "@push.rocks/tapbundle": "^5.0.3",
17
- "@types/node": "^22.15.3"
16
+ "@types/node": "^22.15.19"
18
17
  },
19
18
  "dependencies": {
20
19
  "@push.rocks/smartping": "^1.0.7",
@@ -61,7 +60,7 @@
61
60
  "url": "https://code.foss.global/push.rocks/smartnetwork/issues"
62
61
  },
63
62
  "scripts": {
64
- "test": "(tstest test/)",
63
+ "test": "(tstest test/ --verbose)",
65
64
  "build": "(tsbuild --web --allowimplicitany)",
66
65
  "buildDocs": "tsdoc"
67
66
  }
package/readme.hints.md CHANGED
@@ -1 +1,73 @@
1
-
1
+ # Project Analysis
2
+
3
+ ## Architecture Overview
4
+ This is a comprehensive network diagnostics toolkit that provides various network-related utilities. The main entry point is the `SmartNetwork` class which orchestrates all functionality.
5
+
6
+ Key features:
7
+ - Speed testing via Cloudflare (parallelizable with duration support)
8
+ - Ping operations with statistics
9
+ - Port availability checks (local and remote)
10
+ - Network gateway discovery
11
+ - Public IP retrieval
12
+ - DNS resolution
13
+ - HTTP endpoint health checks
14
+ - Traceroute functionality (with fallback stub)
15
+
16
+ ## Key Components
17
+
18
+ ### SmartNetwork Class
19
+ - Central orchestrator for all network operations
20
+ - Supports caching via `cacheTtl` option for gateway and public IP lookups
21
+ - Plugin architecture for extensibility
22
+
23
+ ### CloudflareSpeed Class
24
+ - Handles internet speed testing using Cloudflare's infrastructure
25
+ - Supports parallel streams and customizable test duration
26
+ - Measures both download and upload speeds using progressive chunk sizes
27
+ - Includes latency measurements (jitter, median, average)
28
+
29
+ ### Error Handling
30
+ - Custom `NetworkError` and `TimeoutError` classes for better error context
31
+ - Error codes follow Node.js conventions (ENOTSUP, EINVAL, ETIMEOUT)
32
+
33
+ ### Logging
34
+ - Global logger interface for consistent logging across the codebase
35
+ - Replaceable logger implementation (defaults to console)
36
+ - Used primarily for error reporting in speed tests
37
+
38
+ ### Statistics Helpers
39
+ - Utility functions for statistical calculations (average, median, quartile, jitter)
40
+ - Used extensively by speed testing and ping operations
41
+
42
+ ## Recent Changes (v4.0.0 - v4.0.1)
43
+ - Added configurable speed test options (parallelStreams, duration)
44
+ - Introduced plugin architecture for runtime extensibility
45
+ - Enhanced error handling with custom error classes
46
+ - Added global logging interface
47
+ - Improved connection management by disabling HTTP connection pooling
48
+ - Fixed memory leaks from listener accumulation
49
+ - Minor formatting fixes for consistency
50
+
51
+ ## Testing
52
+ - Comprehensive test suite covering all major features
53
+ - Tests run on both browser and node environments
54
+ - Uses @push.rocks/tapbundle for testing with expectAsync
55
+ - Performance tests for speed testing functionality
56
+ - Edge case handling for network errors and timeouts
57
+
58
+ ## Technical Details
59
+ - ESM-only package (module type)
60
+ - TypeScript with strict typing
61
+ - Depends on external modules for specific functionality:
62
+ - @push.rocks/smartping for ICMP operations
63
+ - public-ip for external IP discovery
64
+ - systeminformation for network interface details
65
+ - isopen for remote port checking
66
+ - Uses native Node.js modules for DNS, HTTP/HTTPS, and network operations
67
+
68
+ ## Design Patterns
69
+ - Factory pattern for plugin registration
70
+ - Caching pattern with TTL for expensive operations
71
+ - Promise-based async/await throughout
72
+ - Deferred promises for complex async coordination
73
+ - Error propagation with custom error types
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartnetwork',
6
- version: '4.0.1',
6
+ version: '4.0.2',
7
7
  description: 'A toolkit for network diagnostics including speed tests, port availability checks, and more.'
8
8
  }