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

@tenkam/react-native-wifi-scanner

v1.0.0

Published

Bibliotheque React Native pour scanner les reseaux Wi-Fi environnants sur Android

Readme

react-native-wifi-scanner

Bibliothèque React Native pour scanner les réseaux Wi-Fi environnants sur Android.

Installation

npm install react-native-wifi-scanner

Configuration Android (étape obligatoire)

Ouvrez android/app/src/main/java/com/VOTRE_APP/MainApplication.kt et ajoutez une ligne :

import com.wifiscanner.RNWifiScannerPackage  // ← Ajouter cet import

override fun getPackages(): List<ReactPackage> =
    PackageList(this).packages.apply {
        add(RNWifiScannerPackage())  // ← Ajouter cette ligne
    }

Puis recompilez :

cd android && ./gradlew clean && cd ..
npx react-native run-android

Utilisation — Hook (recommandé)

import { useWifiScanner } from 'react-native-wifi-scanner';

const MyComponent = () => {
  const {
    networks,       // tableau des réseaux détectés
    isScanning,     // true pendant le scan
    error,          // message d'erreur ou null
    scan,           // lancer un scan manuel
    stopAutoScan,   // arrêter l'auto-scan
    startAutoScan,  // reprendre l'auto-scan
  } = useWifiScanner({
    autoScan: true,   // scan automatique toutes les 10s
    interval: 10000,  // intervalle en millisecondes
  });

  return (
    <View>
      {isScanning && <Text>Scan en cours...</Text>}
      {networks.map(net => (
        <Text key={net.bssid}>{net.ssid} — {net.rssi} dBm</Text>
      ))}
      <Button title="Scanner" onPress={scan} />
    </View>
  );
};

Utilisation — API directe

import { WifiScanner } from 'react-native-wifi-scanner';

// Vérifier si le Wi-Fi est activé
const enabled = await WifiScanner.isWifiEnabled();

// Lancer un scan et récupérer les résultats
const networks = await WifiScanner.scanNetworks();

// Chaque réseau contient :
// {
//   ssid:         string   — Nom du réseau
//   bssid:        string   — Adresse MAC du routeur
//   rssi:         number   — Signal en dBm (ex: -65)
//   frequency:    number   — Fréquence en MHz (ex: 2437)
//   capabilities: string   — Sécurité (ex: "[WPA2-PSK-CCMP][ESS]")
// }

Fonctions utilitaires incluses

import {
  rssiToPercent,      // -65 dBm → 70%
  rssiToLabel,        // -65 dBm → "Bon"
  frequencyToBand,    // 5180 MHz → "5 GHz"
  frequencyToChannel, // 2437 MHz → canal 6
  rssiToDistance,     // -65 dBm → "~8 m"
  parseSecurityType,  // "[WPA2-PSK]" → "WPA2"
  sortNetworks,       // trier par signal/nom/fréquence/sécurité
  filterNetworks,     // filtrer par SSID ou BSSID
  computeStats,       // statistiques globales
} from 'react-native-wifi-scanner';

Permissions

Les permissions suivantes sont automatiquement ajoutées au Manifest de l'application lors du build (fusion automatique Android) :

  • ACCESS_WIFI_STATE
  • CHANGE_WIFI_STATE
  • ACCESS_FINE_LOCATION ← obligatoire pour voir les SSID sur Android 6+
  • ACCESS_COARSE_LOCATION
  • ACCESS_NETWORK_STATE

La bibliothèque gère automatiquement la demande de permission runtime (dialog système) via le hook useWifiScanner.


Compatibilité

| Plateforme | Support | |-----------|---------| | Android | ✅ API 23+ (Android 6.0+) | | iOS | ❌ Non supporté (retourne des données de test) |


Auteur

Benito Tenkam — Licence MIT