{"id":18498727,"url":"https://github.com/thingssdk/wifiscanner","last_synced_at":"2025-04-09T00:31:23.167Z","repository":{"id":81548690,"uuid":"73161074","full_name":"thingsSDK/wifiscanner","owner":"thingsSDK","description":"A simple wifiscanner for Node.js","archived":false,"fork":false,"pushed_at":"2020-10-01T06:44:56.000Z","size":70,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:51:34.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/thingsSDK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-08T07:35:59.000Z","updated_at":"2021-12-06T21:00:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"fefb62a9-ef8b-4e95-8ead-9c40698343a5","html_url":"https://github.com/thingsSDK/wifiscanner","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fwifiscanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fwifiscanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fwifiscanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fwifiscanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thingsSDK","download_url":"https://codeload.github.com/thingsSDK/wifiscanner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949919,"owners_count":21023412,"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":[],"created_at":"2024-11-06T13:42:19.239Z","updated_at":"2025-04-09T00:31:23.160Z","avatar_url":"https://github.com/thingsSDK.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WiFi Scanner\n\n[![Build Status](https://travis-ci.org/thingsSDK/wifiscanner.svg?branch=master)](https://travis-ci.org/thingsSDK/wifiscanner)\n[![codecov](https://codecov.io/gh/thingsSDK/wifiscanner/branch/master/graph/badge.svg)](https://codecov.io/gh/thingsSDK/wifiscanner)\n[![Dependency Status](https://david-dm.org/thingssdk/wifiscanner.svg)](https://david-dm.org/thingssdk/wifiscanner)\n[![devDependency Status](https://david-dm.org/thingssdk/wifiscanner/dev-status.svg)](https://david-dm.org/thingssdk/wifiscanner#info=devDependencies)\n\nA simple Node.js WiFi Scanner for Windows, Linux and macOS. Works great on embedded devices like the Raspberry Pi.\n\n## Installation\n\n```\nnpm install wifiscanner\n```\n\n## Basic Usage\n\n1. Require `wifiscanner`\n2. Create an instance of a `scanner`\n3. Call `scan` with a callback with two parameters\n4. Profit?\n\n```javascript\nconst wifiscanner = require(\"wifiscanner\");\n\n//Returns appropriate instance of a wifi scanner\nconst scanner = wifiscanner();\n\nscanner.scan((error, networks) =\u003e {\n    if(error) {\n        console.error(error);\n    } else {\n        console.dir(networks);\n    }\n});\n\n```\n\nNetwork is an `Array` of nearby networks. Each network will have the following keys:\n\n* ssid\n* mac\n* channel\n* security (`Array` e.g `[ 'WPA', 'WPA2' ]`)\n\n\n### JSON Sample Output\n\n```\n[\n    {\n        ssid: 'wifi with-n0-s3cur1ty!',\n        mac: '16:0d:7f:49:da:e1',\n        channel: '1',\n        security: ['None']\n    },\n    {\n        ssid: 'WEP enabled',\n        mac: '16:0d:7f:49:da:e2',\n        channel: '1',\n        security: ['WEP']\n    },\n    {\n        ssid: 'WPA1 Enabled',\n        mac: '16:0d:7f:49:da:e3',\n        channel: '1',\n        security: ['WPA']\n    },\n    {\n        ssid: 'WPA1+WPA2',\n        mac: '16:0d:7f:49:da:e4',\n        channel: '1',\n        security: ['WPA', 'WPA2'],\n    },\n    {\n        ssid: 'WPA2 Only',\n        mac: '16:0d:7f:49:da:e5',\n        channel: '1',\n        security: ['WPA2']\n    }\n]\n```\n\nThere is a limitation on _Windows_. If there is a network that is both `WPA` and `WPA2` security, only `WPA2` will be reported.\n\n## Less Basic Usage\n\n### Custom binaries and arguments\n\nYou can specify binary (`binaryPath`) and arguments (`args`) in a set of `options`.\n\n```javascript\nconst wifiscanner = require(\"wifiscanner\");\n\n\n//Options\nconst options = {\n    args: \"wlan2 scan\",\n    binaryPath: \"/path/to/iwlist\"\n}\n\nconst scanner = wifiscanner(options);\n\nscanner.scan(function(error, networks){\n    if(error) {\n        console.error(error);\n    } else {\n        console.dir(networks);\n    }\n});\n\n```\n\n### Handling stderr\n\nStandard error can is more of a warning. For example, if you're on Linux with `wlan0`, `en0` and `lo`\nand you run the `iwlist scan` command you get both the `stdout` of the networks on the `wlan0` network interface\n(which is parsed in to the `networks` `Array`) and the `stderr` of:\n\n```\nlo        Interface doesn't support scanning.\n\neth0      Interface doesn't support scanning.\n```\n\nThe default behavior from this module is to do nothing. However, you can pass in a second _optional_ callback to the\n`scan` method and do what you want with it.\n\n```javascript\nconst wifiscanner = require(\"wifiscanner\");\n\n\n//Options\nconst options = {\n    args: \"wlan2 scan\",\n    binaryPath: \"/path/to/iwlist\"\n}\n\nconst scanner = wifiscanner(options);\n\nscanner.scan(function(error, networks){\n    //...\n}, function(standardError){\n    console.error(standardError);\n});\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingssdk%2Fwifiscanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingssdk%2Fwifiscanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingssdk%2Fwifiscanner/lists"}