npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@codelinefi/maclookup

v1.0.1

Published

Node.js library for MAC Vendor Lookup API by macaddress.io

Downloads

6

Readme

MacAddress.io API client library in Node.js

Comprehensive and up-to-date data provided directly from the IEEE Standards Association

Installing

npm install @codelinefi/maclookup

Requirements

  • Node 6 or higher

Documentation

Full API documentation available here

Getting started

Basic usage


const ApiClient = require('@codelinefi/maclookup');
let client = new ApiClient('Your API key');

client.get('18810E', function (err, result) {
    if (err) {
        console.log(err);
    } else {
        console.log(result);
    }
});


client.getRawData('18810E', 'xml', function (err, result) {
    if (err) {
        console.log(err);
    } else {
        console.log(result);
    }
});

client.getVendor('18810E', function (err, result) {
    if (err) {
        console.log(err);
    } else {
        console.log(result);
    }
});


// Response
ResponseModel {
  vendorDetails: 
   { oui: '18810E',
     isPrivate: false,
     companyName: 'Apple, Inc',
     companyAddress: '1 Infinite Loop Cupertino  CA  95014 US',
     countryCode: 'US' },
  blockDetails: 
   { blockFound: true,
     borderLeft: '18810E0000000000',
     borderRight: '18810EFFFFFFFFFF',
     blockSize: 1099511627776,
     assignmentBlockSize: 'MA-L',
     dateCreated: '2018-06-28',
     dateUpdated: '2018-06-28' },
  macAddressDetails: 
   { searchTerm: '18810E',
     isValid: false,
     transmissionType: 'multicast',
     administrationType: 'LAA' 
   } 
}

<Response>
	<vendorDetails>
		<oui>18810E</oui>
		<isPrivate>false</isPrivate>
		<companyName>Apple, Inc</companyName>
		<companyAddress>1 Infinite Loop Cupertino  CA  95014 US</companyAddress>
		<countryCode>US</countryCode>
	</vendorDetails>
	<blockDetails>
		<blockFound>true</blockFound>
		<borderLeft>18810E0000000000</borderLeft>
		<borderRight>18810EFFFFFFFFFF</borderRight>
		<blockSize>1099511627776</blockSize>
		<assignmentBlockSize>MA-L</assignmentBlockSize>
		<dateCreated>2018-06-28</dateCreated>
		<dateUpdated>2018-06-28</dateUpdated>
	</blockDetails>
	<macAddressDetails>
		<searchTerm>18810E</searchTerm>
		<isValid>false</isValid>
		<transmissionType>multicast</transmissionType>
		<administrationType>LAA</administrationType>
	</macAddressDetails>
</Response>

Apple, Inc

Running examples

To run examples, you need to specify the API_KEY environment variable:

export API_KEY='<your API KEY>'
node basic.js
...

Classes

ApiClient class

/**
 *
 * @param {string} apiKey
 * @param {string} url
 */
constructor(apiKey, url)

/**
 *
 * @param {string} mac - MAC address or OUI
 * @param {callback} cb - The callback to run after API request has finished.
 */
get(mac, cb)

/**
 *
 * @param {string} mac - MAC address or OUI
 * @param {string} format - The response format
 * @param {callback} cb - The callback to run after API request has finished.
 */
getRawData(mac, format, cb)

/**
 *
 * @param {string} mac - MAC address or OUI
 * @param {callback} cb - The callback to run after API request has finished.
 */
getVendor(mac, cb)    

Models

ResponseModel

Sample response object. Be careful, some fields could be null

response = {
  vendorDetails: { 
     oui: '18810E',
     isPrivate: false,
     companyName: 'Apple, Inc',
     companyAddress: '1 Infinite Loop Cupertino  CA  95014 US',
     countryCode: 'US' 
  },
  blockDetails: { 
     blockFound: true,
     borderLeft: '18810E0000000000',
     borderRight: '18810EFFFFFFFFFF',
     blockSize: 1099511627776,
     assignmentBlockSize: 'MA-L',
     dateCreated: '2018-06-28',
     dateUpdated: '2018-06-28' 
  },
  macAddressDetails: { 
     searchTerm: '18810E',
     isValid: false,
     transmissionType: 'multicast',
     administrationType: 'LAA' 
  }
}

Be careful! This library may emit a warning if the server responses with Deprecation Warning

(node:3627) DeprecationWarning: 299 - "Deprecated API Version"

Development

To run tests you need to execute the following commands:

npm install -D
export API_KEY='test'
npm test