node-wireless
Install
Install the module via yarn:
yarn add node-wireless
or via npm if you prefer:
npm install node-wireless
Usage
This module exports a set of functions you can use to interact with wireless (wifi) networks
scan()
import { scan } from 'node-wireless'
const networks = await scan()
connect()
import { connect } from 'node-wireless'
await connect()
disconnect()
import { disconnect } from 'node-wireless'
await disconnect()
Caveats
Managing wifi networks on windows is currently completly messed up to put it politely:
-
First off theres no machine readable output of the command line utility (netsh) used for managing those networks,
meaning one has write custom parsers for every command.
Secondly as if no maschine readable ouput wasn't enough the netsh output is also internationalized, so some important keywords are translated into the primary language set in windows.
-
The second big thing is that the only way to force windows to trigger a scan of wifi networks is to click on the wifi icon in the task-bar. This means users already connected to a wifi network will not be able to see any other networks from the output of netsh, which is really annoying.
-
Thirdly and lastly, netsh is the polar opposite of consistent, with options having different names or different ways to set them between different commands. As well as the incredibly convoluted and pointlessly complex way you connect to wifi networks.
Examples
Api
Contributing
License