6.6.0 • Published 11 months ago

getmac v6.6.0

Weekly downloads
12,585
License
Artistic-2.0
Repository
github
Last release
11 months ago

getmac

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.

Install

npm

  • Install: npm install --save getmac
  • Import: import pkg from ('getmac')
  • Require: const pkg = require('getmac').default

Deno

import pkg from 'https://unpkg.com/getmac@^6.6.0/edition-deno/index.ts'

Editions

This package is published with the following editions:

  • getmac/source/index.ts is TypeScript source code with Import for modules
  • getmac aliases getmac/edition-es2022/index.js
  • getmac/edition-es2022/index.js is TypeScript compiled against ES2022 for Node.js 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • getmac/edition-es2022-esm/index.js is TypeScript compiled against ES2022 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for modules
  • getmac/edition-types/index.d.ts is TypeScript compiled Types with Import for modules
  • getmac/edition-deno/index.ts is TypeScript source code made to be compatible with Deno

History

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

Backers

Code

Discover how to contribute via the CONTRIBUTING.md file.

Authors

Maintainers

Contributors

Finances

Sponsors

  • Andrew Nesbitt — Software engineer and researcher
  • Balsa — We're Balsa, and we're building tools for builders.
  • Codecov — Empower developers with tools to improve code quality and testing.
  • Poonacha Medappa
  • Rob Morris
  • Sentry — Real-time crash reporting for your web apps, mobile apps, and games.
  • Syntax — Syntax Podcast

Donors

License

Unless stated otherwise all works are:

and licensed under:

6.5.0

11 months ago

6.6.0

11 months ago

6.1.0

1 year ago

6.2.0

1 year ago

6.3.0

12 months ago

5.21.0

1 year ago

6.0.0

1 year ago

6.4.0

12 months 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

4 years ago

5.10.0

4 years ago

5.9.0

4 years ago

5.8.0

4 years ago

5.6.0

4 years ago

5.7.0

4 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

6 years ago

1.4.2

6 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