Registry / networking / cordova-arp-cache-fetch

cordova-arp-cache-fetch

JSON →
library0.3.2jsnpmunverified

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.

npm install cordova-arp-cache-fetch
INSTALL
IMPORT
SIG · CORDOVA-ARP-CACHE-
C
cordova-arp-cache-fetch
networkingjavascriptv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

ARP
✓ // Wait for deviceready then use window.ARP
✗ const ARP = require('cordova-arp-cache-fetch');
This is a Cordova plugin, not an npm module. Access via global ARP object after deviceready event.
getRawCache
✓ ARP.getRawCache(successCallback, errorCallback);
✗ var raw = ARP.getRawCache();
Method is async; relies on callbacks. No promise support.
getParsedCache
✓ ARP.getParsedCache(successCallback, errorCallback);
✗ const result = ARP.getParsedCache();
Returns parsed JSON array of objects with ip, hwType, flags, mac, mask, device.

Demonstrates waiting for deviceready, calling getParsedCache, and iterating over entries.

// Ensure Cordova device is ready document.addEventListener('deviceready', function() { // Get ARP cache entries as array of objects window.ARP.getParsedCache(function(entries) { console.log('ARP entries:', entries); // Filter for entries with valid MAC entries.forEach(function(entry) { if(entry.mac !== '00:00:00:00:00:00') { console.log(entry.ip + ' -> ' + entry.mac); } }); }, function(err) { console.error('Error fetching ARP cache:', err); }); }, false);
Debug
Known issues
gotchaARP object is global but only available after deviceready event. Accessing before ready throws ReferenceError.
fix
Always wrap ARP calls inside a deviceready listener.
affects: >=0.1.0
gotchaPlugin only works on Android devices. No iOS or browser support.
fix
Check platform before using: if (cordova.platformId === 'android') { ... }
affects: >=0.1.0
gotchaARP cache content relies on /proc/net/arp which may be empty or restricted on newer Android versions (10+).
fix
Test on target device; consider fallback to alternative network discovery methods.
affects: >=0.1.0
deprecatedPlugin uses deprecated callbacks. No promise or async/await support.
fix
Wrap in a Promise manually: new Promise((resolve, reject) => ARP.getParsedCache(resolve, reject));
affects: >=0.1.0
Errors
Common errors & fixes
ReferenceError: ARP is not defined
Code executed before deviceready event.
fix
Move ARP calls inside deviceready listener.
Error: cordova_plugin_arp_cache_fetch is not supported on this platform
Running on non-Android platform (iOS, browser).
fix
Check platform: if (cordova.platformId === 'android') { ... }
TypeError: ARP.getParsedCache is not a function
Plugin not installed or not properly loaded. May be using wrong import.
fix
Verify plugin installation: cordova plugin list. Access via window.ARP.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
cordova-arp-cache-fetch — npm install cordova-arp-cache-fetch · libregistry