包详细信息

getmacaddress

bevry44MIT1.2.2

Get the mac address of the current machine you are on

mac, mac-address, ifconfig, ipconfig

自述文件

getmacaddress

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Slack community badge Patreon donate button Gratipay donate button Flattr donate button PayPal donate button Bitcoin donate button Wishlist browse button

Get the mac address of the current machine you are on

Install

NPM

  • Install: npm install --save getmacaddress
  • Executable: getmac-node
  • Module: require('getmacaddress')

Browserify

  • Install: npm install --save getmacaddress
  • Module: require('getmacaddress')
  • CDN URL: //wzrd.in/bundle/getmacaddress@1.2.2

Ender

  • Install: ender add getmacaddress
  • Module: require('getmacaddress')

Editions

This package is published with the following editions:

  • getmacaddress/src/lib/getmacaddress.coffee is Source + CoffeeScript + Require
  • getmacaddress aliases getmacaddress/es5/lib/getmacaddress.js
  • getmacaddress/es5/lib/getmacaddress.js is CoffeeScript Compiled JavaScript + ES5 + Require

Usage

CLI

  1. Install Globally: install -g getmac
  2. Run with: getmac-node

API

// Fetch the computer's mac address
require('getmac').getMac(function(err,macAddress){
    if (err)  throw err
    console.log(macAddress)
})

// Validate that an address is a mac address
if ( require('getmac').isMac("e4:ce:8f:5b:a7:fc") ) {
    console.log('valid mac')
}
else {
    console.log('invalid mac')
}

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Patreon donate button Gratipay donate button Flattr donate button PayPal donate button Bitcoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

更新日志

History

v1.2.1 2016 May 10

v1.1.0 2016 May 10

  • Updated dependencies
  • Repackaged

v1.0.7 2015 March 5

  • Added fix for iproute2 commands in absence of ifconfig on Linux machines

v1.0.6 2013 October 27

  • Repackaged

v1.0.5 2013 September 2

  • Will now ignore zero-filled mac addresses and error if none are found
  • Can now pass an optional object as the first argument to getmac that can contain data as a String to scan instead of executing the appropriate command to fetch the data
  • Dependency updates

v1.0.4 2013 February 12

  • Better compatibility with linux distros

v1.0.3 2013 February 12

  • Minor optimisation

v1.0.2 2013 February 12

  • Fixed windows support, turns out they format mac addresses differently

v1.0.1 2013 February 12

  • Renamed getmac executable to getmac-node to avoid conflict on windows

v1.0.0 2013 February 12

  • Initial working commit