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

tg-mini-dev

v1.0.5

Published

Professional development server wrapper with ngrok tunnel support for Telegram Mini Apps. Works with any framework.

Readme

🚀 tg-mini-dev

Dev server wrapper with ngrok tunnel for Telegram Mini Apps. Works with any framework.

npm version License: MIT

Why?

Testing Telegram Mini Apps requires HTTPS. This tool wraps your dev server and automatically creates an ngrok tunnel with smart plan handling:

  • Free plan: Tunnels to preview build (avoids rate limits)
  • Paid plan: Tunnels to dev server (hot reload works!)

Install

npm install -D tg-mini-dev

Quick Start

# 1. Add to package.json
{
  "scripts": {
    "tunnel": "tg-mini-dev"
  }
}

# 2. Create .env
NGROK_AUTHTOKEN=your_token
NGROK_DOMAIN=your-domain.ngrok.io
NGROK_PLAN=free

# 3. Run
npm run tunnel

How It Works

tg-mini-dev runs your existing npm run dev/build/preview commands and manages ngrok tunnel. Ports are auto-injected:

npm run dev  →  npm run dev --port 5173 --host 0.0.0.0

No need to configure ports in Vite/Webpack/Next.js!

Configuration

.env (Simple)

NGROK_AUTHTOKEN=xxx
NGROK_DOMAIN=your-domain.ngrok.io
NGROK_PLAN=free
DEV_PORT=5173
PREVIEW_PORT=4173

tg-mini-dev.config.js

export default {
  devPort: 5173,
  previewPort: 4173,
  
  ngrokPlan: 'free', // or 'paid'
  ngrokAuthtoken: process.env.NGROK_AUTHTOKEN,
  ngrokDomain: process.env.NGROK_DOMAIN,
  
  devCommand: 'npm run dev',
  buildCommand: 'npm run build',
  previewCommand: 'npm run preview',
  
  autoBuild: true, // Auto-build on startup (free plan)
};

Full config example →

Ngrok Plans

| Plan | Behavior | Hot Reload | Rate Limits | |------|----------|------------|-------------| | Free | Tunnel → preview build | ❌ (use build cmd) | Avoids limits | | Paid | Tunnel → dev server | ✅ Through tunnel | No issues |

Free Plan Workflow

1. npm run dev      → Local dev (localhost:5173)
2. npm run build    → Production build
3. npm run preview  → Preview server (localhost:4173)
4. ngrok tunnel     → https://your-domain.ngrok.io
5. Type "build"     → Rebuild & restart

Paid Plan Workflow

1. npm run dev   → Dev server (localhost:5173)
2. ngrok tunnel  → https://your-domain.ngrok.io (with HMR!)

Framework Examples

Vite

{
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview",
    "tunnel": "tg-mini-dev"
  }
}

Next.js

// tg-mini-dev.config.js
export default {
  devPort: 3000,
  ngrokPlan: 'paid', // Recommended for Next.js
  devCommand: 'npm run dev',
  buildCommand: 'npm run build',
  previewCommand: 'npm run start',
};

Custom/Vanilla

export default {
  devPort: 8080,
  devCommand: 'npx live-server',
  buildCommand: 'echo "No build"',
  previewCommand: 'npx serve dist',
};

CLI Commands

In interactive mode:

  • build - Rebuild & restart (free plan)
  • exit - Stop all services
  • help - Show commands

Programmatic API

import { startDevServer } from 'tg-mini-dev';

await startDevServer({
  devPort: 5173,
  ngrokPlan: 'paid',
});

Config Reference

| Option | Type | Default | Description | |--------|------|---------|-------------| | devPort | number | 5173 | Dev server port (auto-injected) | | previewPort | number | 4173 | Preview server port (auto-injected) | | ngrokAuthtoken | string | - | Ngrok token | | ngrokDomain | string | - | Ngrok domain | | ngrokPlan | 'free' | 'paid' | 'free' | Plan type | | devCommand | string | 'npm run dev' | Dev server command | | buildCommand | string | 'npm run build' | Build command | | previewCommand | string | 'npm run preview' | Preview command | | host | string | '0.0.0.0' | Server host | | autoBuild | boolean | true | Auto-build on start (free) | | silent | boolean | false | Suppress logs |

FAQ

Q: Why not just use ngrok directly?
A: We handle plan differences, process management, auto-restart, and port injection.

Q: Works with my framework?
A: Yes. We just wrap your npm scripts.

Q: Do I need to change my setup?
A: No. Just add tunnel script.

Q: What if no ngrok config?
A: Runs dev server normally without tunnel.

TypeScript

import type { TgMiniDevConfig } from 'tg-mini-dev';

const config: TgMiniDevConfig = {
  devPort: 5173,
  ngrokPlan: 'paid',
};

Examples

Check examples/ for:

  • Vite, Next.js, Webpack setups
  • Custom frameworks
  • Advanced API usage

License

MIT © Anton Bielousov


Built for the Telegram Mini Apps community 💙