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

@lynx-js/debug-router-connector

v0.0.10

Published

debuger router connector

Readme

DebugRouterConnector

Background

DebugRouterConnector is an npm package implemented in TypeScript

  • Provides the function of connecting to DebugRouter
  • An interface for sending and receiving messages.

DebugRouterConnector

1. Connect USB Device, Desktop Device, Network Device

  • USB Device: android phone, iphone connected by USB
  • Desktop Device: local device (mac, windows, linux)
  • Network Device: a remote device (ip, port)

Connect to App

import { DebugRouterConnector } from '@lynx-js/debug-router-connector';

const connector = new DebugRouterConnector({
  manualConnect: true,
// When manualConnect is true, you need to call connectDevices to connect to the device
// and use connectUsbClients to connect USB clients.
// When manualConnect is false, DebugRouterConnector will automatically connect to devices and USB clients.
  enableWebSocket: false, // deprecated
  enableAndroid: true,
  enableIOS: true,
  enableHarmony: true,
  enableDesktop: true,
  enableNetworkDevice: true,
  networkDeviceOpt: {
    ip: xx;
    port:[port];
  };
});

Get Connected Clients

You have two ways to get the connected clients.

The first way:

When you set the parameter manualConnect to true, you can call the connectDevices method to get a list of devices connected by DebugRouterConnector. Then, you can use the connectUsbClients method to get the clients of a specified device.

// The connectDevices method requires a timeout parameter to wait for devices to connect.
// Once the timeout period expires, connectDevices will return all connected devices.
const devices = await connector.connectDevices(5000);

// The connectUsbClients method requires a timeout parameter to wait for clients to connect and a deviceId parameter to specify which device to connect to.
// Once the timeout period expires, connectUsbClients will return all connected clients of the specified device.
const clients = await connector.connectUsbClients(devices[0].serial, 5000);
The second way:

Regardless of whether manualConnect is true or false, you can listen to these events to get the status of devices and clients.

connector.on('device-connected', (device) => {});
connector.on('device-disconnected', (device) => {});
connector.on('client-connected', (client) => {});
connector.on('client-disconnected', (clientId)=>{});

Send Message

  // send sendCustomizedMessage
  // sessionId: -1 : This message is a global message.
  // sessionId > 0: This message is sent to a view.
  sendCustomizedMessage(method: string, params: Object = '', sessionId: number = -1, type: string = 'CDP'): Promise<string>

  // send ClientMessageHandler's message
  sendClientMessage(method: string, params: Object = {}): Promise<string>

RegisterEvent handler

// This event is sent by DebugRouterEventSender.send in the app or as a CDP event sent by LynxDevTool.
client.on(event, (args...) => {});

Security

If you discover a potential security issue in this project, or believe you have found one, we kindly ask that you notify TikTok Security through our security center or via email at vulnerability reporting email. Your contributiong in ensuring the security of this project is greatly appreciated.

Please do not create a public GitHub issue.

License

This project is licensed under the Apache-2.0 License.