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 🙏

© 2025 – Pkg Stats / Ryan Hefner

connect-local-db

v1.0.4

Published

Expose your local PostgreSQL database via ngrok for remote access.

Readme

connect-local-db

Expose your local PostgreSQL database to the internet using ngrok, allowing remote access from your hosted apps or tools.

Designed for developers who need remote access to local PostgreSQL databases during development.


🚀 Features

  • Simple CLI — connect in under 1 minute
  • Secure tunnel via ngrok (TCP)
  • Password input is hidden
  • Local DB connection is validated before tunnel starts
  • Perfect for connecting hosted backend services to your dev database

📦 Installation

Option 1: Use with npx (recommended)

npx connect-local-db

Option 2: Install globally

npm install -g connect-local-db

🛠️ Prerequisites

  1. PostgreSQL must be running locally on your machine.
  2. You must have an ngrok account and set your auth token:
npx ngrok config add-authtoken <your_ngrok_token>

🧪 Usage

Run:

npx connect-local-db

You'll be prompted to enter:

  • PostgreSQL port (default: 5432)
  • DB user (default: postgres)
  • Password (input hidden)
  • Database name

If the connection is successful, you’ll get:

✅ Local PostgreSQL connected successfully.
🔗 Ngrok tunnel created: tcp://4.tcp.eu.ngrok.io:14006
✅ You can now connect to your dev DB remotely.

🔗 How to Use the Tunnel Info

From the ngrok output like:

tcp://4.tcp.eu.ngrok.io:14006

Use:

| Field | Value | | ------------ | -------------------- | | Host | 4.tcp.eu.ngrok.io | | Port | 14006 | | User | your PostgreSQL user | | Password | your DB password | | Database | your DB name |

Make sure to omit the tcp:// when entering host.


💡 Example Use Cases

  • Connect your local DB to a remote backend (e.g., hosted on Vercel, Heroku, etc.)
  • Enable cloud services or APIs to access your dev data
  • Share your dev DB with collaborators

❗ Common Issues

getaddrinfo ENOTFOUND tcp://...

Don't use the full tunnel URL directly. Instead:

  • Host: 4.tcp.eu.ngrok.io (without tcp://)
  • Port: 14006 (or the actual port from your tunnel)

🔐 Security Tips

  • Do not use this tool in production.
  • Do not share your ngrok tunnel publicly.
  • Close the tunnel when done (Ctrl + C in the terminal).

🧑‍💻 Author

Made by Olugbenga Taiwo Contributions welcome!


📄 License

MIT License