Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wifi-controller

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wifi-controller

Manage Wi-Fi state on macOS, Windows, and Linux

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
0
Weekly downloads
 
Created
Source

Wifi Controller

NPM version Build Status License: MIT

wifi-controller is a Node.js module that allows you to manage Wi-Fi on and off states programmatically on macOS and Windows. It provides a simple API to turn Wi-Fi on, off, toggle the state, and restart the Wi-Fi adapter.

Table of Contents

Installation

You can install wifi-controller using npm:

npm install wifi-controller

Usage

Here is a simple example to demonstrate how to use wifi-controller:

const WifiController = require("wifi-controller");

(async () => {
  await WifiController.off();
  console.log("Wi-Fi is off");

  await WifiController.on();
  console.log("Wi-Fi is on");

  const name = await WifiController.device();
  console.log(`Wi-Fi device name: ${name}`);

  const isOn = await WifiController.isOn();
  console.log(`Wi-Fi is ${isOn ? "on" : "off"}`);
})();

API

WifiController

All methods return a Promise.

on()

Turns the Wi-Fi on.

off()

Turns the Wi-Fi off.

toggle(force)

Toggles the Wi-Fi state. Optionally pass a boolean to force a state.

restart()

Restarts the Wi-Fi (turns it off and then on).

isOn()

Returns a Promise indicating whether the Wi-Fi is on.

device()

Returns a Promise with the Wi-Fi device name.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs

Package last updated on 26 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc