@arcanewizards/net-utils 0.1.0 → 0.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.
Files changed (2) hide show
  1. package/README.md +51 -0
  2. package/package.json +17 -12
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # `@arcanewizards/net-utils`
2
+
3
+ [![](https://img.shields.io/npm/v/@arcanewizards/net-utils)](https://www.npmjs.com/package/@arcanewizards/net-utils)
4
+
5
+ Small Node.js networking helpers shared by the Arcane Wizards packages.
6
+
7
+ The package currently focuses on IPv4 interface discovery and common connection-status types used by higher-level transport packages such as `@arcanewizards/artnet` and `@arcanewizards/tcnet`.
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ pnpm add @arcanewizards/net-utils
13
+ ```
14
+
15
+ ## Requirements
16
+
17
+ - Node.js `>=22.12.0 || >=23.1.0`
18
+
19
+ ## Exports
20
+
21
+ - `getNetworkInterfaces()`
22
+ Returns a map of IPv4 interfaces keyed by interface name.
23
+ - `ConnectionConfig`
24
+ Shared target shape for host-based and interface-based network configuration.
25
+ - `NetworkInterface`
26
+ Describes a resolved IPv4 interface, including its broadcast address.
27
+ - `NetworkPortStatus`
28
+ Describes runtime status for a network port or range.
29
+
30
+ ## Usage
31
+
32
+ ```ts
33
+ import { getNetworkInterfaces } from '@arcanewizards/net-utils';
34
+
35
+ const interfaces = await getNetworkInterfaces();
36
+
37
+ for (const [name, iface] of Object.entries(interfaces)) {
38
+ console.log(name, iface.address, iface.broadcastAddress);
39
+ }
40
+ ```
41
+
42
+ ## Return Shape
43
+
44
+ Each entry returned by `getNetworkInterfaces()` includes:
45
+
46
+ - `name`
47
+ - `address`
48
+ - `internal`
49
+ - `broadcastAddress`
50
+
51
+ Only IPv4 addresses are included.
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@arcanewizards/net-utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ArcaneWizards/open-source.git",
9
+ "directory": "packages/net-utils"
10
+ },
6
11
  "exports": {
7
12
  ".": {
8
13
  "@arcanewizards/source": "./src/index.ts",
@@ -15,23 +20,23 @@
15
20
  "files": [
16
21
  "dist"
17
22
  ],
18
- "scripts": {
19
- "build": "rm -rf dist && tsup && check-export-map",
20
- "check:types": "tsc --noEmit",
21
- "format:fix": "cd .. && pnpm format:fix",
22
- "lint": "eslint . --max-warnings 0",
23
- "lint:fix": "eslint --fix ."
24
- },
25
23
  "devDependencies": {
26
- "@arcanewizards/eslint-config": "workspace:^",
27
- "@arcanewizards/typescript-config": "workspace:^",
28
24
  "@types/node": "^25.0.3",
29
25
  "check-export-map": "^1.3.1",
30
26
  "eslint": "^9",
31
27
  "tsup": "^8.1.0",
32
- "typescript": "^5.7.3"
28
+ "typescript": "^5.7.3",
29
+ "@arcanewizards/eslint-config": "^0.0.0",
30
+ "@arcanewizards/typescript-config": "^0.0.0"
33
31
  },
34
32
  "engines": {
35
33
  "node": ">=22.12.0 || >=23.1.0"
34
+ },
35
+ "scripts": {
36
+ "build": "rm -rf dist && tsup && check-export-map",
37
+ "check:types": "tsc --noEmit",
38
+ "format:fix": "cd .. && pnpm format:fix",
39
+ "lint": "eslint . --max-warnings 0",
40
+ "lint:fix": "eslint --fix ."
36
41
  }
37
- }
42
+ }