This version is a fork of official repo with fixes and improvements for windows. I'll push changes to original repo soon. I added getting list of saved networks and connection to saved networks without passowrd. Also applied bug fixes from official repo that didn't merged yet.
I have great ambitions for this project and I am looking for maintainers who could help me to handle all improvements and bug fixes about this project because the hardware/os dependencies make it quite hard to test. You can contact me at thibault.friedrich@gmail.com.
The node-wifi module allows macOS, windows and linux users to interact with surrounding wifi networks through various methods. These methods include scanning for wifi access points and connecting to these access points.
Features | Linux | Mac | Windows |
---|---|---|---|
Connect | ✓ | ✓ | ✓ |
Scan | ✓ | ✓ | ✓ |
List current wifi connections | ✓ | ✓ | ✓ |
Disconnect | ✓ | ✓ | |
Delete connection information | ✓ | ✓ |
We wish to be clear in saying that this module is inspired from node-wifi-control but with some slight modifications to certain functions such as the various OS-specific parsers for terminal output as we noticed that these parsers did not work well on certain operating systems.
As everything with hardware dependencies, weird behaviors may happen depending of your configuration. You should never hesitate to notify us about a specificity of your OS/Hardware/Wifi card/whatever.
Install
# Use as a module npm install node-wifi # Use as a CLI npm install node-wifi -g
Getting started
var wifi = ; // Initialize wifi module// Absolutely necessary even to set interface to nullwifi; // Scan networkswifi; // Connect to a networkwifi; // Disconnect from a network// not available on all os for nowwifi; // Delete a saved network// not available on all os for nowwifi; // List the current wifi connectionswifi; // All functions also return promise if there is no callback givenwifi ;
Use as CLI
wifi --scan wifi --connect --ssid <ssid> --password <password> --iface <wlan0> wifi --disconnect wifi --current
Platforms compatibility
This project is tested with operating systems:
- macOS Catalina 10.15.5
Do not hesitate to create a pull request to add the OS you are using.
Dependencies
Linux:
- network-manager
Contribute
Please read development guidelines before proposing a pull request.
Roadmap
- add conventional commits
- plug to travis
- add github templates
- add eslint
- add prettier
- switch to MIT license
- generate changelog and release note
- stdout how to reproduce bug
- add unit tests
- rewrite the library using ES7
- use github actions
- install commitizen
- use xml to stabilize parsers