DylanPiercey / local-devices

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

multiple async operations, same result #70

Open celevra opened 11 months ago

celevra commented 11 months ago

hi,

giving this example:

const find = require('local-devices');
var nets = ['192.168.172.1/24', '192.168.10.222/24', '192.168.152.1/24']
for (var n in nets)
{
  find({ address: nets[n] }).then(devices => {
    console.log(nets[n])
    console.log(devices)
  })
}

will return the different nets, but in all 3 returns the same devices. Seems like its not async compatible

regards