{"id":16476,"library":"oui-data","title":"IEEE OUI Database","description":"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.","status":"active","version":"1.1.571","language":"javascript","source_language":"en","source_url":"https://github.com/silverwind/oui-data","tags":["javascript"],"install":[{"cmd":"npm install oui-data","lang":"bash","label":"npm"},{"cmd":"yarn add oui-data","lang":"bash","label":"yarn"},{"cmd":"pnpm add oui-data","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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');`","wrong":"import ouiData from 'oui-data';","symbol":"ouiData","correct":"import ouiData from 'oui-data' with {type: 'json'};"},{"note":"CommonJS require works directly as the package exports a JSON file.","symbol":"ouiData","correct":"const ouiData = require('oui-data');"},{"note":"Directly importing the JSON file might be preferred in some bundler configurations or environments for explicit path resolution.","wrong":"import { ouiData } from 'oui-data';","symbol":"ouiData","correct":"import data from 'oui-data/index.json';"}],"quickstart":{"code":"import ouiData from 'oui-data' with {type: 'json'};\n\nconst lookupOUI = (oui) => {\n  const entry = ouiData[oui.toUpperCase()];\n  if (entry) {\n    return `${entry.company} - ${entry.address}\\n${entry.city} ${entry.state} ${entry.zipCode}\\n${entry.country}`;\n  } else {\n    return `OUI '${oui}' not found.`;\n  }\n};\n\nconsole.log(lookupOUI('203706'));\n// Example for an unknown OUI\nconsole.log(lookupOUI('000000'));","lang":"javascript","description":"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."},"warnings":[{"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.","message":"Importing JSON files in ECMAScript Modules (ESM) requires specific syntax that varies by environment.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Access properties like `ouiData['203706']` directly. Do not expect methods or classes.","message":"The package exports a raw JSON object, not a module with functions. Access data directly using bracket notation.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Convert your OUI string to uppercase before using it as a key: `ouiData[yourOUI.toUpperCase()]`.","message":"The OUI keys in the JSON are uppercase strings (e.g., '203706'). Ensure your lookup keys are also uppercase for correct matching.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"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.","cause":"Your JavaScript environment does not support import attributes (`with {type: 'json'}`) or import assertions (`assert {type: 'json'}`).","error":"SyntaxError: Unexpected token 'with'"},{"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) { /* ... */ }`.","cause":"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).","error":"TypeError: Cannot read properties of undefined (reading 'company')"}],"ecosystem":"npm"}