
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
Get current machine IPv4, IPv6, MAC and DNS servers.
DNS servers receive from /etc/resolv.conf.
npm install address
Get IP is sync and get MAC is async for now.
import { ip, ipv6, mac } from 'address';
// default interface 'eth' on linux, 'en' on osx.
ip(); // '192.168.0.2'
ipv6(); // 'fe80::7aca:39ff:feb0:e67d'
mac(function (err, addr) {
console.log(addr); // '78:ca:39:b0:e6:7d'
});
// local loopback
ip('lo'); // '127.0.0.1'
// vboxnet MAC
mac('vboxnet', function (err, addr) {
console.log(addr); // '0a:00:27:00:00:00'
});
const { ip, ipv6, mac } = require('address');
// default interface 'eth' on linux, 'en' on osx.
ip(); // '192.168.0.2'
ipv6(); // 'fe80::7aca:39ff:feb0:e67d'
mac(function (err, addr) {
console.log(addr); // '78:ca:39:b0:e6:7d'
});
// local loopback
ip('lo'); // '127.0.0.1'
// vboxnet MAC
mac('vboxnet', function (err, addr) {
console.log(addr); // '0a:00:27:00:00:00'
});
import { address } from 'address';
address((err, addrs) => {
console.log(addrs.ip, addrs.ipv6, addrs.mac);
// '192.168.0.2', 'fe80::7aca:39ff:feb0:e67d', '78:ca:39:b0:e6:7d'
});
address('vboxnet', (err, addrs) => {
console.log(addrs.ip, addrs.ipv6, addrs.mac);
// '192.168.56.1', null, '0a:00:27:00:00:00'
});
const { address } = require('address');
address((err, addrs) => {
console.log(addrs.ip, addrs.ipv6, addrs.mac);
// '192.168.0.2', 'fe80::7aca:39ff:feb0:e67d', '78:ca:39:b0:e6:7d'
});
address('vboxnet', (err, addrs) => {
console.log(addrs.ip, addrs.ipv6, addrs.mac);
// '192.168.56.1', null, '0a:00:27:00:00:00'
});
import { getInterfaceAddress } from 'address';
getInterfaceAddress('IPv4', 'eth1');
// { address: '192.168.1.1', family: 'IPv4', mac: '78:ca:39:b0:e6:7d' }
const { getInterfaceAddress } = require('address');
getInterfaceAddress('IPv4', 'eth1');
// { address: '192.168.1.1', family: 'IPv4', mac: '78:ca:39:b0:e6:7d' }
import { dns } from 'address';
dns((err, servers) => {
console.log(servers);
// ['10.13.2.1', '10.13.2.6']
});
const { dns } = require('address');
dns((err, servers) => {
console.log(servers);
// ['10.13.2.1', '10.13.2.6']
});
import { address, mac, dns } from 'address/promises';
const addr = await address();
const macAddress = await mac();
const servers = await dns();
fengmk2 | alsotang | jkelleyrtp | slyon | mariodu | mathieutu |
|---|---|---|---|---|---|
zhangyuheng | semantic-release-bot | coolme200 | whxaxes |
This project follows the git-contributor spec, auto updated at Fri Sep 22 2023 20:49:32 GMT+0800.
The 'ip' package is similar to 'address' in that it provides utilities for IP address manipulation and querying. However, it focuses more on the manipulation and calculation of IP addresses rather than retrieving network interface details.
The 'network' package offers functionality to get network information such as the user's IP, MAC address, and network interfaces, similar to 'address'. However, it also includes additional features like checking internet connectivity, which 'address' does not provide.
While not a third-party package, Node.js's built-in 'os' module provides some overlapping functionality with 'address', such as retrieving network interfaces. However, 'address' offers more detailed and specific network information retrieval capabilities.
FAQs
Get current machine IP, MAC and DNS servers.
The npm package address receives a total of 4,167,724 weekly downloads. As such, address popularity was classified as popular.
We found that address demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.