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

@hivescale/connect-uniapp

v0.0.1

Published

HiveScale application-scoped network client for uni-app

Readme

HiveScale uni-app Connect SDK

@hivescale/connect-uniapp is an application-scoped adapter for uni-app. It does not install a system VPN or change DNS from JavaScript.

Runtime behavior

  • H5 delegates HTTP/HTTPS and MagicDNS to @hivescale/connect.
  • uni-app App delegates HTTP/HTTPS, TCP, and UDP to a native plugin through a small JSON/event protocol.
  • H5 cannot expose raw TCP or UDP because browser JavaScript has no raw socket API. dialTcp and dialUdp return UNSUPPORTED_RUNTIME on H5.

Install

npm install @hivescale/connect-uniapp

For H5, also install the web SDK:

npm install @hivescale/connect

H5

import { createClient } from '@hivescale/connect-uniapp';

const client = createClient({
  runtime: 'h5',
  authKey: shortLivedAuthKey,
  controlURL: 'https://hs-ctl.hivescale.net',
});

await client.connect();
const response = await client.fetch('http://fileserver:8080/health');
console.log(await response.text());
await client.close();

App native plugin

The native plugin is obtained with the normal uni-app plugin mechanism and is adapted with createUniAppNativeBridge:

import { createClient, createUniAppNativeBridge } from '@hivescale/connect-uniapp';

const plugin = uni.requireNativePlugin('HiveScaleConnect');
const client = createClient({
  runtime: 'app',
  nativeBridge: createUniAppNativeBridge(plugin),
  authKey: shortLivedAuthKey,
  hostname: 'my-uniapp-device',
});

await client.connect();
const response = await client.fetch('http://fileserver:8080/health');
const tcp = await client.dialTcp('dbserver', 5432);
tcp.on('data', (data) => console.log(data));
await tcp.write(new TextEncoder().encode('ping'));

const udp = await client.dialUdp('metrics', 8125);
udp.on('message', (data) => console.log(data));
await udp.send(new TextEncoder().encode('metric'));

await client.close();

The plugin must implement connect, fetch, dialTcp, writeTcp, closeTcp, dialUdp, sendUdp, closeUdp, and close. It must also expose a subscribe(callback) method and optionally unsubscribe(). Each operation uses the uni-app callback form (arguments, successCallback, failureCallback); the callback result is either the operation result or { ok: false, code, message }. It must call the event callback with tcpData, tcpClosed, tcpError, udpMessage, udpClosed, and udpError events. Payloads are base64 encoded in dataBase64; connection IDs are returned as { id: string }.

For Android App plugins, the reusable implementation is in libs/mobile-connect/android/src/main/kotlin/net/hivescale/connect/android/: HiveScaleMobileConnectManager owns the Go userspace node and HiveScaleUniAppNativeBridge maps the JavaScript method names to it. The libs/uniapp-connect/native/android contains the DCloud UniModule wrapper; copy it into the native plugin project, add the DCloud plugin SDK and generated hivescale-mobile-connect.aar, then register HiveScaleConnectModule under the HiveScaleConnect plugin name. The wrapper does not request VpnService.

AuthKeys should be short-lived and issued by a trusted service. Do not embed an administrator key in a uni-app bundle.