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

dev-notify-bridge

v1.0.3

Published

Lightweight local HTTP bridge that delivers native desktop notifications for containerized or remote Node.js environments (Docker, WSL)

Readme


dev-notify-bridge

Lightweight local HTTP bridge that delivers native desktop notifications for containerized or remote Node.js environments (Docker, WSL). Use dev-notify for direct local Node.js notifications; use dev-notify-bridge when your app runs in an environment that cannot access the host desktop directly.


Table of contents


Overview

dev-notify-bridge is a tiny HTTP server that runs on your host machine and accepts JSON POST requests to trigger native desktop notifications (macOS Notification Center, Windows Toasts, Linux notify-send). It is intentionally minimal, secure by default, and intended for local development only.

A typical flow:

  1. Run dev-notify-bridge on your host.
  2. From inside a container (or remote environment), POST a notification payload to the bridge.
  3. The bridge uses node-notifier to show a native desktop notification.

When to use

  • You run your application inside Docker, WSL, or a remote VM and want desktop toasts for events (OTPs, errors, build completion).
  • You do not need this in production — it’s explicitly a developer convenience tool.

Note: dev-notify is a separate client-side package that sends notifications directly from local Node.js processes. dev-notify-bridge is the host-side relay used when the app cannot show notifications itself.


Install

Globally (recommended for developer machines):

npm install -g dev-notify-bridge

Or run without installing:

npx dev-notify-bridge

Quick start

Start the bridge (default port 6789):

npx dev-notify-bridge

Start on a custom port:

PORT=5454 npx dev-notify-bridge
# or
npx dev-notify-bridge --port 5454

You should see:

 dev-notify-bridge running at http://localhost:6789
💬 Ready to receive notifications

API

POST /notify

Triggers a native desktop notification.

Request JSON

{
  "title": "string",       // required
  "message": "string",     // required
  "sound": true|false,     // optional, default true
  "wait": true|false       // optional, default false
}

Success response (200)

{
  "success": true,
  "backend": "desktop",
  "response": "Notification delivered",
  "metadata": {
    "hostname": "your-machine",
    "platform": "darwin|win32|linux"
  }
}

Error response (4xx/5xx)

{
  "success": false,
  "backend": "desktop",
  "error": "Error message"
}

Example (curl)

curl -X POST http://localhost:6789/notify \
  -H "Content-Type: application/json" \
  -d '{"title":"Build OK","message":"API built successfully","sound":true}'

CLI

Run the bridge:

npx dev-notify-bridge [--port <port>] [--verbose]

Options:

  • --port, -p — server port (default 6789)
  • --verbose, -v — enable verbose logging

Environment variable:

  • PORT — alternate way to set the port.

Docker integration examples

1. Run a container and allow it to reach the host bridge

docker run --rm \
  --add-host=host.docker.internal:host-gateway \
  my-image

Inside the container, send a notification to the bridge:

// example using axios in container
await axios.post('http://host.docker.internal:6789/notify', {
  title: 'Container Ready',
  message: 'Service listening on :3000'
});

2. docker-compose (env var)

services:
  api:
    build: .
    environment:
      - DEV_NOTIFY_BRIDGE=http://host.docker.internal:6789
    # For Linux hosts that need it:
    # extra_hosts:
    #   - "host.docker.internal:host-gateway"

Using --add-host=host.docker.internal:host-gateway or extra_hosts is recommended for cross-platform resolution.


Security & best practices

  • Local-only by default: the server binds to 127.0.0.1 (localhost) for safety. Do not expose it publicly.
  • Authentication: intentionally omitted for convenience in local dev. If you must use this across a network, add an auth layer or use SSH port forwarding.
  • Production: do not use in production; it is a development tool only.
  • Logging: use --verbose to debug notification delivery during setup.

Troubleshooting

  • host.docker.internal DNS not found (Linux) Use --add-host=host.docker.internal:host-gateway when running the container, or set DEV_NOTIFY_BRIDGE to the host IP resolved by your environment.

  • No notification appears but API responded 200

    • Ensure node-notifier supports your platform (Linux may need notify-send available).
    • Check system notification settings (do-not-disturb, focus assist).
    • Try --verbose to view bridge logs.
  • Bridge fails to start (port in use) Start with a different port: PORT=5454 npx dev-notify-bridge.


Contributing

Contributions, issues, and feature requests are welcome.

Suggested workflow:

  1. Fork the repo and create a branch.
  2. Run npm install and npm run build.
  3. Add tests or examples for new behavior.
  4. Open a PR with a clear description and motivation.

Please follow standard code style.


License

MIT © 2025