{"id":13583113,"url":"https://github.com/friedrith/node-wifi","last_synced_at":"2025-05-15T23:03:25.209Z","repository":{"id":10045931,"uuid":"63230836","full_name":"friedrith/node-wifi","owner":"friedrith","description":"📶 NodeJS tool to manage wifi (connections, scans)","archived":false,"fork":false,"pushed_at":"2023-09-02T00:53:14.000Z","size":1175,"stargazers_count":410,"open_issues_count":75,"forks_count":163,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-15T23:02:36.318Z","etag":null,"topics":["hardware","node","scanning","wifi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/friedrith.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-13T08:56:53.000Z","updated_at":"2025-05-12T23:04:33.000Z","dependencies_parsed_at":"2024-01-15T01:09:02.851Z","dependency_job_id":"9961320c-4dd2-494d-98e9-c4f7a6e965db","html_url":"https://github.com/friedrith/node-wifi","commit_stats":{"total_commits":242,"total_committers":33,"mean_commits":7.333333333333333,"dds":0.640495867768595,"last_synced_commit":"1a4364e67c9789555a00656d35287f0cebb3add8"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedrith%2Fnode-wifi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedrith%2Fnode-wifi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedrith%2Fnode-wifi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedrith%2Fnode-wifi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friedrith","download_url":"https://codeload.github.com/friedrith/node-wifi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436944,"owners_count":22070946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hardware","node","scanning","wifi"],"created_at":"2024-08-01T15:03:15.745Z","updated_at":"2025-05-15T23:03:25.187Z","avatar_url":"https://github.com/friedrith.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/friedrith/assets/master/node-wifi/logo.png\" alt=\"node-wifi\" /\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://img.shields.io/github/workflow/status/friedrith/node-wifi/build\" alt=\"build\" /\u003e\n\u003cimg src=\"https://img.shields.io/bundlephobia/min/node-wifi\" alt=\"size\" \u003e\n\u003cimg src=\"https://img.shields.io/npm/v/node-wifi?color=green\u0026label=npm%20package\" alt= \"version\"\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003e We think about switching to ES Modules only for next major release. We would like to have your opinion on this. Please consider leave a comment in the [discussion thread](https://github.com/friedrith/node-wifi/discussions/170).\n\n**I am looking for maintainers who could help me to handle all improvements and\nbug fixes about this project because the hardware/os dependencies make it quite\nhard to test.**\n\nThe 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.\n\n\u003cdiv align=\"center\"\u003e\n\n| Features                      | Linux | Mac | Windows |\n| ----------------------------- | ----- | --- | ------- |\n| Connect                       | ✓     | ✓   | ✓       |\n| Scan                          | ✓     | ✓   | ✓       |\n| List current wifi connections | ✓     | ✓   | ✓       |\n| Disconnect                    | ✓     |     | ✓       |\n| Delete connection information | ✓     | ✓   |         |\n\n\u003c/div\u003e\n\nWe wish to be clear in saying that this module is inspired from [node-wifi-control](https://github.com/msolters/wifi-control-node) 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.\n\n\u003e 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.\n\n---\n\n## Install\n\n```bash\n# Use as a module\nnpm install node-wifi\n```\n\n## Getting started\n\n```javascript\nconst wifi = require('node-wifi');\n\n// Initialize wifi module\n// Absolutely necessary even to set interface to null\nwifi.init({\n  iface: null // network interface, choose a random wifi interface if set to null\n});\n\n// Scan networks\nwifi.scan((error, networks) =\u003e {\n  if (error) {\n    console.log(error);\n  } else {\n    console.log(networks);\n    /*\n        networks = [\n            {\n              ssid: '...',\n              bssid: '...',\n              mac: '...', // equals to bssid (for retrocompatibility)\n              channel: \u003cnumber\u003e,\n              frequency: \u003cnumber\u003e, // in MHz\n              signal_level: \u003cnumber\u003e, // in dB\n              quality: \u003cnumber\u003e, // same as signal level but in %\n              security: 'WPA WPA2' // format depending on locale for open networks in Windows\n              security_flags: '...' // encryption protocols (format currently depending of the OS)\n              mode: '...' // network mode like Infra (format currently depending of the OS)\n            },\n            ...\n        ];\n        */\n  }\n});\n\n// Connect to a network\nwifi.connect({ ssid: 'ssid', password: 'password' }, () =\u003e {\n  console.log('Connected'); \n  // on windows, the callback is called even if the connection failed due to netsh limitations\n  // if your software may work on windows, you should use `wifi.getCurrentConnections` to check if the connection succeeded\n});\n\n// Disconnect from a network\n// not available on all os for now\nwifi.disconnect(error =\u003e {\n  if (error) {\n    console.log(error);\n  } else {\n    console.log('Disconnected');\n  }\n});\n\n// Delete a saved network\n// not available on all os for now\nwifi.deleteConnection({ ssid: 'ssid' }, error =\u003e {\n  if (error) {\n    console.log(error);\n  } else {\n    console.log('Deleted');\n  }\n});\n\n// List the current wifi connections\nwifi.getCurrentConnections((error, currentConnections) =\u003e {\n  if (error) {\n    console.log(error);\n  } else {\n    console.log(currentConnections);\n    /*\n    // you may have several connections\n    [\n        {\n            iface: '...', // network interface used for the connection, not available on macOS\n            ssid: '...',\n            bssid: '...',\n            mac: '...', // equals to bssid (for retrocompatibility)\n            channel: \u003cnumber\u003e,\n            frequency: \u003cnumber\u003e, // in MHz\n            signal_level: \u003cnumber\u003e, // in dB\n            quality: \u003cnumber\u003e, // same as signal level but in %\n            security: '...' //\n            security_flags: '...' // encryption protocols (format currently depending of the OS)\n            mode: '...' // network mode like Infra (format currently depending of the OS)\n        }\n    ]\n    */\n  }\n});\n\n// All functions also return promise if there is no callback given\nwifi\n  .scan()\n  .then(networks =\u003e {\n    // networks\n  })\n  .catch(error =\u003e {\n    // error\n  });\n```\n\n\n## Use as CLI\n\n`node-wifi` is also usable as a CLI tool with the library [node-wifi-cli](https://github.com/friedrith/node-wifi-cli).\n\n## Platforms compatibility\n\nThis project is tested with operating systems:\n\n- macOS Catalina 10.15.5\n- macOS Big Sur 11.5.1\n- linux Ubuntu 18.04.3 LTS\n\n\u003e Do not hesitate to create a pull request to add the OS you are using.\n\n## Dependencies\n\nLinux:\n\n- network-manager (nmcli)\n\nWindows:\n\n- netsh \n\nMacOS:\n\n- airport\n- networksetup\n\n## Contribute\n\nPlease read [development guidelines](./CONTRIBUTING.md) before proposing a pull request.\n\n## Roadmap\n\n- [x] add conventional commits\n- [x] plug to travis\n- [x] add github templates\n- [x] add eslint\n- [x] add prettier\n- [x] switch to MIT license\n- [x] generate changelog and release note\n- [x] stdout how to reproduce bug\n- [x] use github actions\n- [ ] add unit tests (in progress)\n- [ ] rewrite the library using ES7 (in progress)\n- [ ] harmonize security flags and modes\n- [ ] install commitizen\n- [ ] use xml to stabilize parsers\n","funding_links":[],"categories":["JavaScript","Fingerprint","Packages"],"sub_categories":["Network map"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedrith%2Fnode-wifi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriedrith%2Fnode-wifi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedrith%2Fnode-wifi/lists"}