Registry / data / oui-data

oui-data

JSON →
library1.1.571jsnpmunverified

oui-data provides the IEEE Organizationally Unique Identifier (OUI) database as a static JSON file, enabling programmatic access to MAC address vendor information. The current stable version is 1.1.571. This package primarily serves as a data source, with updates typically tied to upstream IEEE OUI registry changes and dependency bumps, implying an as-needed release cadence rather than a fixed schedule. Its key differentiator is simplicity and direct JSON export, making it easy to consume in environments that support JSON module imports or require/import raw JSON. It eschews any processing logic or API, focusing solely on delivering the raw, structured OUI data.

npm install oui-data
INSTALL
IMPORT
SIG · OUI-DATA
O
oui-data
datajavascriptv1.1.571
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ouiData
import ouiData from 'oui-data' with {type: 'json'};
import ouiData from 'oui-data';
ESM JSON module import requires 'with {type: "json"}' or 'assert {type: "json"}' in most environments (Node.js >= 17.1, Webpack, Vite). Bun might not require it. Older Node.js or CJS requires `const ouiData = require('oui-data');`
ouiData
const ouiData = require('oui-data');
CommonJS require works directly as the package exports a JSON file.
ouiData
import data from 'oui-data/index.json';
import { ouiData } from 'oui-data';
Directly importing the JSON file might be preferred in some bundler configurations or environments for explicit path resolution.

Demonstrates how to import the oui-data JSON and perform a lookup for a specific OUI to retrieve vendor information, handling both found and not-found cases.

import ouiData from 'oui-data' with {type: 'json'}; const lookupOUI = (oui) => { const entry = ouiData[oui.toUpperCase()]; if (entry) { return `${entry.company} - ${entry.address}\n${entry.city} ${entry.state} ${entry.zipCode}\n${entry.country}`; } else { return `OUI '${oui}' not found.`; } }; console.log(lookupOUI('203706')); // Example for an unknown OUI console.log(lookupOUI('000000'));
Debug
Known issues
gotchaImporting JSON files in ECMAScript Modules (ESM) requires specific syntax that varies by environment.
fix
Use `import ouiData from 'oui-data' with {type: 'json'};` for modern environments, or `import ouiData from 'oui-data' assert {type: 'json'};` for older Node.js/bundlers. For CommonJS, `const ouiData = require('oui-data');` works universally.
affects: >=1.0.0
gotchaThe package exports a raw JSON object, not a module with functions. Access data directly using bracket notation.
fix
Access properties like `ouiData['203706']` directly. Do not expect methods or classes.
affects: >=1.0.0
gotchaThe OUI keys in the JSON are uppercase strings (e.g., '203706'). Ensure your lookup keys are also uppercase for correct matching.
fix
Convert your OUI string to uppercase before using it as a key: `ouiData[yourOUI.toUpperCase()]`.
affects: >=1.0.0
Errors
Common errors & fixes
SyntaxError: Unexpected token 'with'
Your JavaScript environment does not support import attributes (`with {type: 'json'}`) or import assertions (`assert {type: 'json'}`).
fix
For CommonJS, use `const ouiData = require('oui-data');`. For ESM, check your Node.js version (needs >=17.1 for assertions) or bundler configuration to ensure support for JSON modules. You might need to directly import `oui-data/index.json` and configure your bundler to handle it as raw JSON.
TypeError: Cannot read properties of undefined (reading 'company')
Attempted to access properties of an OUI entry that does not exist in the database, likely due to a mismatch in the OUI string (e.g., wrong case or non-existent OUI).
fix
Verify that the OUI string you are using is valid and uppercase. Always check if the lookup result is `undefined` before accessing its properties: `const entry = ouiData[oui.toUpperCase()]; if (entry) { /* ... */ }`.
Upgrade
Version history
1.1.571latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
oui-data — npm install oui-data · libregistry