npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-wifi-plus

v1.1.0

Published

Advanced WiFi manager for Node.js built on top of node-wifi. Adds events, auto-reconnect, signal monitoring, forced fresh scans, and many useful utilities.

Readme

node-wifi-plus

Advanced WiFi manager for Node.js built on top of node-wifi.

It adds a clean EventEmitter API, auto-reconnect, signal monitoring, useful utilities, Promise support, and forced fresh scans (the main fix for stale network lists).


What's new in 1.1.0

Fixed: Stale / cached scan results

Previously scan() could return an old list of networks because the OS (especially Windows and some Linux setups) caches scan results.

Now by default every scan() forces a real OS-level rescan:

| Platform | Method used to force scan | |----------|--------------------------------------------| | Linux | nmcli device wifi rescan (+ fallback) | | Windows | netsh wlan show networks mode=bssid | | macOS | airport -s |

You can still disable it if you want the old (faster but sometimes stale) behavior:

const wifi = new WifiPlus({ forceFreshScan: false });
// or per-call:
await wifi.scan({ force: false });

Features

| Feature | Status | Notes | |--------------------------------|--------|--------------------------------------------| | Scan networks | ✅ | Now forces real scan by default | | Connect / Disconnect | ✅ | Clean async API | | Auto-reconnect | ✅ | Optional, configurable | | Event system | ✅ | connect, disconnect, reconnect, etc. | | Signal strength monitoring | ✅ | Emits signalChange and lowSignal | | Current connection info | ✅ | SSID, signal, quality | | Wait helpers | ✅ | waitForConnection, waitForDisconnect | | Best network selection | ✅ | Connect to strongest signal | | TypeScript definitions | ✅ | Full .d.ts included | | Cross-platform | ✅ | Windows, macOS, Linux (via node-wifi) |


Installation

npm install node-wifi-plus

Quick Start

const WifiPlus = require('node-wifi-plus');

const wifi = new WifiPlus({
  iface: null,           // auto-detect interface
  autoReconnect: true,
  watchInterval: 4000,
  forceFreshScan: true,  // default – always get fresh networks
  debug: false
});

// Listen to events
wifi.on('connect', (network) => {
  console.log('Connected to:', network.ssid);
});

wifi.on('disconnect', () => {
  console.log('Disconnected');
});

wifi.on('networkChange', (network) => {
  console.log('Switched to:', network.ssid);
});

wifi.on('lowSignal', (network) => {
  console.log('Weak signal on', network.ssid, network.signal_level, 'dBm');
});

wifi.on('error', (err) => {
  console.error('WiFi error:', err.message);
});

// Use the API
(async () => {
  // This now forces a real scan every time
  const networks = await wifi.scan();
  console.log('Found networks:', networks.length);

  // await wifi.connect('MyNetwork', 'password123');
  // const current = await wifi.getCurrentConnection();
})();

Constructor Options

new WifiPlus({
  iface: null,                 // Network interface (null = auto)
  autoReconnect: false,        // Automatically reconnect on drop
  watchInterval: 4000,         // Status check interval (ms)
  lowSignalThreshold: -75,     // dBm threshold for lowSignal event
  forceFreshScan: true,        // Force real OS scan on every scan() (recommended)
  debug: false                 // Enable debug logs
});

scan() options

// Force a fresh scan (default)
const networks = await wifi.scan();
const networks = await wifi.scan({ force: true });

// Skip force-rescan (faster, may return cached data)
const networks = await wifi.scan({ force: false });

Events

| Event | Description | Payload | |------------------|------------------------------------------|----------------------------------| | connect | Successfully connected | network | | disconnect | Disconnected | — | | reconnect | Auto-reconnected | network | | networkChange | Connected network changed | network | | scan | Scan finished | networks[] | | scanning | Scan started | — | | status | Periodic status update | { connected, network, signal } | | signalChange | Signal changed significantly | { oldSignal, newSignal, network } | | lowSignal | Signal dropped below threshold | network | | error | Any error | Error |


Notes & Limitations

  • This module is a high-level wrapper around node-wifi.
  • Forced scan makes results much more reliable but is slightly slower (extra 0.8–1.5 s).
  • Some features (especially saved network listing) depend on OS support.
  • Always run with appropriate permissions (especially on Linux).
  • Auto-reconnect uses the system’s saved profiles (password is not stored by this module).

License

MIT


Built with ❤️ on top of node-wifi