DylanPiercey / local-devices

🔮 Find devices connected to the current local network.
MIT License
139 stars 27 forks source link

Added flag to skip name resolution #36

Closed dickydoouk closed 3 years ago

dickydoouk commented 3 years ago

It was noticed on my mac and raspberry pi that arm -a can take a while whilst it resolves hostnames. A more performant approach is to use arp -an which does not resolve host names. With the obvious caveat that host names are not returned.

As a side point neither my mac or raspberry pi return host names.

The flag can be set by calling await find(null, true)

natterstefan commented 3 years ago

Hi @dickydoouk,

thanks for submitting the PR. It is great to have this option to improve the performance of the local-devices. I cannot confirm that I do not get hostnames when running arp -a but I see there are use-cases where one is not interested in using the hostnames but other information from the command.

Would you mind making sure coveralls is happy with the changes, and document the new option in the README too, please?

dickydoouk commented 3 years ago

Have documented in README.md and fixed coveralls by adding empty exec response scenario. Also realised that arp -an does not work on windows hosts so have checked the host before selecting which arp switches to use.

asterizk commented 3 years ago

I'd really love to have this feature... any chance someone might be able to review it?

natterstefan commented 3 years ago

Hi @asterizk,

thanks for getting in touch. I asked @dickydoouk if he could update PR according to my change requests. Once that is done, I'm happy to process the PR further.

dickydoouk commented 3 years ago

Will get those done ASAP. Sorry for the delay.

dickydoouk commented 3 years ago

PR updated @natterstefan

dickydoouk commented 3 years ago

Any chance this PR can be merged @DylanPiercey? Thx

DylanPiercey commented 3 years ago

Hey @dickydoouk and @natterstefan. Apologize for how long it's taken me to get to this.

It is hard for me to properly maintain modules that I don't actively use myself. This module is particularly tricky because it has cross platform quirks and I don't typically spin up a windows vm to test. Also its setup to use travis which doesn't support open source anymore and so needs a transition to github actions. Luckily github actions would allow us to test on windows.

I hope to be able to invest some time soon into this module to setup automated deployments, github actions (with testing on windows) and some other tooling modernization. It's hard when I've got so much else on the go!

Having said that, I think the change is benign enough to get out as a minor release. I will do that right now.

DylanPiercey commented 3 years ago

Released in 3.2.0