5.20.0-next.1627593726.e7cd9844b817a1faac9c5e2e60030f98a528c92d • Published 4 years ago

getmac v5.20.0-next.1627593726.e7cd9844b817a1faac9c5e2e60030f98a528c92d

Weekly downloads
12,585
License
MIT
Repository
github
Last release
4 years ago

Get the MAC address of the current machine you are on.

This library will not run in web browsers / on the client-side / in webpack / in browserify / in angular / in react / in jQuery / in HTML. It will only run on Node.js environments, which the web browser is not.

Usage

Complete API Documentation.

CLI

Install globally npm install -g getmac, then run with getmac-node

API

Install locally npm install --save getmac, then use like so:

import getMAC, { isMAC } from 'getmac'

// Fetch the computer's MAC address
console.log(getMAC())

// Fetch the computer's MAC address for a specific interface
console.log(getMAC('eth0'))

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

Advanced

If you want to do advanced filtering, use os.networkInterfaces() instead.

npm

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

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

These amazing people are maintaining this project:

No sponsors yet! Will you be the first?

These amazing people have contributed code to this project:

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

Unless stated otherwise all works are:

and licensed under:

6.5.0

2 years ago

6.6.0

2 years ago

6.1.0

2 years ago

6.2.0

2 years ago

6.3.0

2 years ago

5.21.0

2 years ago

6.0.0

2 years ago

6.4.0

2 years ago

5.20.0

4 years ago

5.19.0

4 years ago

5.18.0

4 years ago

5.17.0

5 years ago

5.16.0

5 years ago

5.15.0

5 years ago

5.14.0

5 years ago

5.13.0

5 years ago

5.12.0

5 years ago

5.11.0

5 years ago

5.10.0

5 years ago

5.9.0

5 years ago

5.8.0

5 years ago

5.6.0

5 years ago

5.7.0

5 years ago

5.5.0

5 years ago

5.4.0

5 years ago

5.3.0

5 years ago

5.2.0

5 years ago

5.1.0

6 years ago

5.0.0

6 years ago

4.4.0

6 years ago

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.5.0

6 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.7

11 years ago

1.0.6

12 years ago

1.0.5

12 years ago

1.0.4

13 years ago

1.0.3

13 years ago

1.0.2

13 years ago

1.0.1

13 years ago

1.0.0

13 years ago