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

auto-adb

v2.2.0

Published

A CLI tool to automatically execute ADB commands when Android devices connect.

Readme

auto-adb

GitHub Repo npm version npm download npm license

A CLI tool to automatically execute commands when Android devices connect through ADB.

Why need this?

To reduce repetitive tasks when connecting Android devices to your computer.

Imagine a scenario where you frequently connect your Android device to your computer for development or testing purposes. Each time you connect the device, you need to run a series of commands to set up the environment, such as configuring port forwarding, setting up proxies, or installing necessary apps. This can be tedious and time-consuming.

Features

In short, this tool provides the following features:

  • Automatically execute specified commands when devices connect
  • Support for cleanup commands when the tool exits

Installation

You can install auto-adb globally or use it via npx:

npm install -g auto-adb

# Or use via
npx auto-adb
pnpm dlx auto-adb

Then you can run with --help option to see usage.

Examples

Simple example

Print a message when device connects and when the program exits:

npx auto-adb -c "echo Device @{deviceid} connected" -C "echo Cleaning up for device @{deviceid}"

Open scrcpy every time an Android device connects:

npx auto-adb -c "scrcpy -s @{deviceid}"

For web developers

For example, here is a workflow for web developers who would like to do the following every time an Android device connects:

  1. Reverse port 8080 from the Android device to the computer to access MITM server running on the computer.
  2. Setup http proxy address to 127.0.0.1:8080 on the Android device to intercept HTTP(S) traffic.

And dev hope to run cleanup commands when the this CLI tool exits:

  1. Remove the port reverse rule.
  2. Clear the http proxy setting on the Android device.

Thus, the command would be:

npx auto-adb \
-c "adb -s @{deviceid} reverse tcp:8080 tcp:8080" \
-c "adb -s @{deviceid} shell settings put global http_proxy 127.0.0.1:8080" \
-C "adb -s @{deviceid} reverse --remove tcp:8080" \
-C "adb -s @{deviceid} shell settings put global http_proxy :0"

Requirements

  • Node.js 18 or higher