Closed felixgalindo closed 6 years ago
Same problem here. Can it be fixed? update: looking at the source code I see that I had to run it as a Promise
wifi.getCurrentConnections().then(wifi => this.net.ssid = wifi[0].ssid).catch(err => console.log(err))
Shouldn't the instructions be updated?
To anybody else ending up here and being too eager to wait for a fix, here's what I did: https://github.com/peterbe/howsmywifi/blob/2c479bcbd344fce0b9a77b9fe972a38e24b78262/index.js#L30-L68
I only have a mac so I wouldn't even be able to test node-wifi
on non-macs. The spawn()
solution works for mac. I was going to use that as a fallback.
As mentioned no need for a fix, just call the Promise as explained above. And it will work on all platforms.
Sweet! Thanks. Removed my hack
Sorry for the late. I have pushed a new version that corrects the bug of callback on macOS.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I too get nothing:
Using the latest version.