{"id":44611,"library":"cordova-arp-cache-fetch","title":"Cordova ARP Cache Fetch Plugin","description":"Cordova plugin for Android that retrieves the ARP cache to map IP addresses to MAC addresses on the local network. Version 0.3.2, last updated in 2016. No active development. Provides two methods: getRawCache (returns raw table string) and getParsedCache (returns array of objects). Only supports Android. Limited to reading /proc/net/arp file; contents depend on Android OS.","status":"maintenance","version":"0.3.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install cordova-arp-cache-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add cordova-arp-cache-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add cordova-arp-cache-fetch","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a Cordova plugin, not an npm module. Access via global ARP object after deviceready event.","wrong":"const ARP = require('cordova-arp-cache-fetch');","symbol":"ARP","correct":"// Wait for deviceready then use window.ARP"},{"note":"Method is async; relies on callbacks. No promise support.","wrong":"var raw = ARP.getRawCache();","symbol":"getRawCache","correct":"ARP.getRawCache(successCallback, errorCallback);"},{"note":"Returns parsed JSON array of objects with ip, hwType, flags, mac, mask, device.","wrong":"const result = ARP.getParsedCache();","symbol":"getParsedCache","correct":"ARP.getParsedCache(successCallback, errorCallback);"}],"quickstart":{"code":"// Ensure Cordova device is ready\ndocument.addEventListener('deviceready', function() {\n    // Get ARP cache entries as array of objects\n    window.ARP.getParsedCache(function(entries) {\n        console.log('ARP entries:', entries);\n        // Filter for entries with valid MAC\n        entries.forEach(function(entry) {\n            if(entry.mac !== '00:00:00:00:00:00') {\n                console.log(entry.ip + ' -> ' + entry.mac);\n            }\n        });\n    }, function(err) {\n        console.error('Error fetching ARP cache:', err);\n    });\n}, false);","lang":"javascript","description":"Demonstrates waiting for deviceready, calling getParsedCache, and iterating over entries."},"warnings":[{"fix":"Always wrap ARP calls inside a deviceready listener.","message":"ARP object is global but only available after deviceready event. Accessing before ready throws ReferenceError.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Check platform before using: if (cordova.platformId === 'android') { ... }","message":"Plugin only works on Android devices. No iOS or browser support.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Test on target device; consider fallback to alternative network discovery methods.","message":"ARP cache content relies on /proc/net/arp which may be empty or restricted on newer Android versions (10+).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Wrap in a Promise manually: new Promise((resolve, reject) => ARP.getParsedCache(resolve, reject));","message":"Plugin uses deprecated callbacks. No promise or async/await support.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'/proc/net/arp':55 '0.3.2':27 '2016':31 'activ':33 'address':18,21 'android':9,51,60 'arp':2,13 'array':46 'cach':3,14 'content':57 'cordova':1,6 'depend':58 'develop':34 'fetch':4 'file':56 'getparsedcach':44 'getrawcach':38 'ip':17 'javascript':62 'last':28 'limit':52 'local':24 'mac':20 'map':16 'method':37 'network':25 'object':48 'os':61 'plugin':5,7 'provid':35 'raw':40 'read':54 'retriev':11 'return':39,45 'string':42 'support':50 'tabl':41 'two':36 'updat':29 'version':26","created_at":"2026-06-07T12:50:59.144931+00:00","updated_at":"2026-06-07T12:50:59.144931+00:00","problems":[{"fix":"Move ARP calls inside deviceready listener.","cause":"Code executed before deviceready event.","error":"ReferenceError: ARP is not defined"},{"fix":"Check platform: if (cordova.platformId === 'android') { ... }","cause":"Running on non-Android platform (iOS, browser).","error":"Error: cordova_plugin_arp_cache_fetch is not supported on this platform"},{"fix":"Verify plugin installation: cordova plugin list. Access via window.ARP.","cause":"Plugin not installed or not properly loaded. May be using wrong import.","error":"TypeError: ARP.getParsedCache is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"cordova-arp-cache-fetch","openapi_spec":null,"status_page":null,"smithery":null,"categories":["networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}