Socket
Book a DemoInstallSign in
Socket

manage-wifi

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manage-wifi

Turn your Wi-Fi on and off

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
28
115.38%
Maintainers
1
Weekly downloads
 
Created
Source

manage-wifi

Turn your Wi-Fi on and off

macOS and Windows only, but pull request welcome for Linux support.

Install

$ npm install manage-wifi

Usage

import wifi from 'manage-wifi';

await wifi.off();
console.log('Wi-Fi is off');

await wifi.on();
console.log('Wi-Fi is on');

const name = await wifi.device();
console.log(name);
// macOS => 'en0';
// Windows => 'USB\VID_0BD...'

Note: On Windows, a User Account Control (UAC) dialog may be displayed on Wi-Fi status change.

API

wifi

All the methods return a Promise.

on()

Turn Wi-Fi on.

off()

Turn Wi-Fi off.

toggle(force?)

Invert the Wi-Fi state.

Optionally pass a boolean to force a state.

restart()

Turn Wi-Fi off and on.

isOn()

Returns a Promise<boolean> of whether the Wi-Fi is on.

device()

Returns a Promise<string> with the Wi-Fi device name.

  • manage-wifi-cli - CLI for this module

Keywords

wifi

FAQs

Package last updated on 20 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts