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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-ultrasonic

v1.0.1

Published

Send data over sound technology with fastest and secure way!

Downloads

40

Readme

NPM Version NPM Version PRs Welcome

Introduce

Since there's not a strict API from React Native to allow us to handle operations on Hotspot. So, today I would like to share my small kit with you guys to help most of rn developers to be able to use wifi-hotspot and enjoy its powerful.

The kit is designed to be helpful and to provide an easy API that can suit your needs so let me tell you how this kit can help you a long away with:

  • Talk to your ROBOT!
  • Communicating without an Internet
  • Build yourown SHAREit (Share any types of files locally)
  • Build a tiny network with your friends

Setup

Fetch it using npm or yarn

npm i --save react-naive-wifi-hotspot
OR
yarn add react-native-wifi-hotspot

Then run this command to link it

react-native link react-naive-wifi-hotspot

Almost done just put this lines into Settings.gradle

include ':hotspotmanager'
project(':hotspotmanager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wifi-hotspot/android/hotspotmanager')

💥 Just run it!

Example

🔥 Full Example

Features

  • Enable Hotspot
  • Disable Hotspot
  • Create Hotspot's Settings (SSID, Password, ..)
  • Fetch Hotspot's Settings
  • Get List of Connected Peers

Demo

example app

Get Started

  • Check WIFI is on/off then turn hotspot on and automatically check if hotspot already opened
Hotspot.enable(() => {
      ToastAndroid.show("Hotspot Enabled",ToastAndroid.SHORT);
    }, (err) => {
      ToastAndroid.show(err.toString(),ToastAndroid.SHORT);
    })
  • Check hotspot is on then turn it off and automatically check if hotspot already closed
Hotspot.disable(() => {
      ToastAndroid.show("Hotspot Disabled",ToastAndroid.SHORT);
    }, (err) => {
      ToastAndroid.show(err.toString(),ToastAndroid.SHORT);
    })
  • You can set your own configuration to your hotspot using this function. supported configuration:
    • SSID
    • Password
    • Protocols
    • authAlgorithms
    • Security type

| Parameters | Required | Types | Default | --- | --- | --- | --- | | SSID | * | none | none | password | * | none | password should be provided if you will use our settings | | protocols | - | Hotspot.protocols.RSN Hotspot.protocols.WPA Hotspot.protocols.BOTH| Hotspot.protocols.BOTH | | securityType | - | Hotspot.security.WPA_PSK Hotspot.security.WPA_EAP Hotspot.security.IEEE8021X Hotspot.security.WPA2_PSK | Hotspot.security.WPA2_PSK | | authAlgorithms | - | Hotspot.auth.OPEN Hotspot.auth.SHARED Hotspot.auth.LEAP | Hotspot.auth.SHARED |

const hotspot = {SSID: 'ASSEM', password: 'helloworld', authAlgorithms: Hotspot.auth.OPEN, protocols: Hotspot.protocols.WPA }
    Hotspot.create(hotspot, () => {
      ToastAndroid.show("Hotspot enstablished", ToastAndroid.SHORT);
    }, (err) => {
      ToastAndroid.show(err.toString(), ToastAndroid.SHORT);
    })

You can also use your own old settings without the need of creating new one

  • You can fetch your hotsot's configuration. Supported returning config:
    • ssid
    • password
    • status ( network is enabled or disabled )
    • networkId
config: {
  ssid: string,
  password: string,
  status: boolean ( true means enable, false means disable )
  networkId: Int
}
Hotspot.getConfig((config) => {
      ToastAndroid.show("Hotspot SSID: " + config.ssid, ToastAndroid.SHORT);
    }, (err) => {
      ToastAndroid.show(err.toString(), ToastAndroid.SHORT);
    })
  • Fethcing connected devices to your wifi network. Returned an object for every device contains:
    • ip
    • mac
    • device number
data: [
  results: {
    ip: 192.168.x.x,
    mac: A3:76:E1:33:79:F3,
    device: number
  }
]
Hotspot.peersList((data) => {
      const peers = JSON.parse(data);
    }, (err) => {
      ToastAndroid.show(err.toString(), ToastAndroid.SHORT);
    })