macaddress
Advanced tools
Comparing version 0.5.1 to 0.5.2
12
index.js
@@ -56,8 +56,8 @@ /* jshint node: true */ | ||
addresses[name] = iface.mac; | ||
if (iface.ipv4 || iface.ipv6) { | ||
if (iface.ipv4) { | ||
score += 1; | ||
if (iface.ipv4 && iface.ipv6) { | ||
score += 1; | ||
} | ||
} | ||
if (iface.ipv6) { | ||
score += 1; | ||
} | ||
if (goodIfaces.test(name)) { | ||
@@ -109,6 +109,4 @@ score += 2; | ||
} | ||
var ifaces = lib.networkInterfaces(); | ||
var resolve = {}; | ||
Object.keys(ifaces).forEach(function (iface) { | ||
@@ -119,3 +117,2 @@ if (!ifaces[iface].mac) { | ||
}); | ||
if (Object.keys(resolve).length === 0) { | ||
@@ -127,3 +124,2 @@ if (typeof callback === "function") { | ||
} | ||
util.parallel(resolve, function (err, result) { | ||
@@ -130,0 +126,0 @@ Object.keys(result).forEach(function (iface) { |
{ | ||
"name": "macaddress", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Get the MAC addresses (hardware addresses) of the hosts network interfaces.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ node-macaddress | ||
Retrieve MAC addresses in Linux, OS X, and Windows. | ||
Retrieve [MAC addresses](https://en.wikipedia.org/wiki/MAC_address) in Linux, OS X, and Windows. | ||
@@ -17,2 +17,6 @@ A common misconception about MAC addresses is that every *host* had *one* MAC address, | ||
A common misconception about this library is that it reports the mac address of the client that accesses some kind of backend. It does not. Reporting the mac address is not in any way similar to reporting the IP address of the client that accesses your application. This library reports the mac address of the server the application is running on. This useful for example for distributed/scaled applications, for example when generating UUIDs. | ||
Also it seems to be worth noting that this library is not intended to be used in a browser. There is no web api reporting the mac address of the machine (and that is a good thing). | ||
**Features:** | ||
@@ -69,3 +73,3 @@ | ||
```JavaScript | ||
macaddress.one.then(function (mac) { | ||
macaddress.one().then(function (mac) { | ||
console.log("Mac address for this host: %s", mac); | ||
@@ -72,0 +76,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21109
154