Socket
Book a DemoInstallSign in
Socket

is-mac-address

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-mac-address

Checks if the given string is valid mac address

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
66
-56.29%
Maintainers
1
Weekly downloads
 
Created
Source

is-mac-address

Check if provided string is valid mac address

Installation

Install with npm:

$ npm install is-mac-address --save

Usage

var MAC_ADDRESS = require('is-mac-address')

MAC_ADDRESS.isMACAddress('invalid-str')
// => false

MAC_ADDRESS.isMACAddress('10:10:10:10:11:09')
// => true

MAC_ADDRESS.isMACAddress([])
// => throws TypeError

Clone the repo

$ git clone https://github.com/luthraG/is-mac-address.git

API

isMACAddress(str)

Given a mac address this API checks if it is valid mac address or not

It throws

  • TypeError if str is not provided or if provided but not of type String

Example

var MAC_ADDRESS = require('is-mac-address')

MAC_ADDRESS.isMACAddress('invalid-str')
// => false

MAC_ADDRESS.isMACAddress('10:09:07:06:03:01')
// => true

MAC_ADDRESS.isMACAddress([])
// => throws TypeError


Author

Gaurav Luthra

License

MIT © Gaurav Luthra

Keywords

mac

FAQs

Package last updated on 25 May 2017

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