get-device-ip 1.0.0 → 1.0.1

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 +33 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # get-device-ip 🚀
2
+
3
+ [![npm version](https://img.shields.io/npm/v/get-device-ip.svg)](https://www.npmjs.com/package/get-device-ip)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ A ultra-lightweight, zero-dependency Node.js utility to quickly find your machine's local IPv4 and IPv6 addresses.
7
+
8
+ ### 🌟 Why use this?
9
+
10
+ - **Zero Dependencies**: No bloated `node_modules`.
11
+ - **Modern Node Support**: Fully compatible with Node.js 18, 20, 22+ (handles both string and numeric `family` types).
12
+ - **Clean Output**: Filters out internal loopback addresses (127.0.0.1) automatically.
13
+ - **Cross-Platform**: Works on Windows, macOS, and Linux.
14
+
15
+ ---
16
+
17
+ ## 📦 Installation
18
+
19
+ ```bash
20
+ npm install get-device-ip
21
+
22
+ 🚀 Quick Start
23
+ Since this is an ES Module (ESM) package, ensure your package.json has "type": "module" or use the .js extension.
24
+
25
+
26
+
27
+ import getDeviceIP from 'get-device-ip';
28
+ const ip = getDeviceIP();
29
+
30
+ console.log('My Primary IPv4:', ip.primaryIpv4);
31
+ console.log('All IPv4 Addresses:', ip.IPv4);
32
+
33
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "get-device-ip",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A lightweight utility to get local IPv4 and IPv6 addresses.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,4 +20,4 @@
20
20
  "device-ip",
21
21
  "network"
22
22
  ]
23
- }
23
+ }