Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

macaddress

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

macaddress

Get the MAC addresses (hardware addresses) of the hosts network interfaces.

  • 0.2.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
224K
increased by12.76%
Maintainers
1
Weekly downloads
 
Created

What is macaddress?

The macaddress npm package is a utility for retrieving and working with MAC addresses in Node.js. It provides functionalities to get the MAC address of a network interface, retrieve all MAC addresses on the system, and even spoof MAC addresses.

What are macaddress's main functionalities?

Get MAC address of a specific network interface

This feature allows you to get the MAC address of a specific network interface, such as 'eth0'. The callback function returns the MAC address as a string.

const macaddress = require('macaddress');
macaddress.one('eth0', function (err, mac) {
  console.log(mac); // 'XX:XX:XX:XX:XX:XX'
});

Get all MAC addresses on the system

This feature retrieves all MAC addresses on the system. The callback function returns an object where each key is a network interface and the value is the corresponding MAC address.

const macaddress = require('macaddress');
macaddress.all(function (err, all) {
  console.log(all); // { 'eth0': 'XX:XX:XX:XX:XX:XX', 'eth1': 'YY:YY:YY:YY:YY:YY', ... }
});

Spoof a MAC address

This feature allows you to generate a random MAC address, which can be useful for testing or spoofing purposes. The callback function returns the generated MAC address as a string.

const macaddress = require('macaddress');
macaddress.random(function (err, mac) {
  console.log(mac); // 'ZZ:ZZ:ZZ:ZZ:ZZ:ZZ'
});

Other packages similar to macaddress

Keywords

FAQs

Package last updated on 26 Apr 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc