6.1.0-next.1699990142.1bc2bbb964adf32217acc71cd592c433f8554f8d • Published 1 year ago

getmac v6.1.0-next.1699990142.1bc2bbb964adf32217acc71cd592c433f8554f8d

Weekly downloads
12,585
License
Artistic-2.0
Repository
github
Last release
1 year 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

1 year ago

6.6.0

1 year ago

6.1.0

1 year ago

6.2.0

1 year ago

6.3.0

1 year ago

5.21.0

1 year ago

6.0.0

1 year ago

6.4.0

1 year ago

5.20.0

3 years ago

5.19.0

3 years ago

5.18.0

3 years ago

5.17.0

4 years ago

5.16.0

4 years ago

5.15.0

4 years ago

5.14.0

4 years ago

5.13.0

4 years ago

5.12.0

4 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

5 years ago

5.0.0

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.5.0

5 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.7

10 years ago

1.0.6

11 years ago

1.0.5

11 years ago

1.0.4

12 years ago

1.0.3

12 years ago

1.0.2

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago