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

wrangler-deploy-notify

v1.4.0

Published

Deploy to Cloudflare Workers with automatic deployment notifications

Downloads

9

Readme

wrangler-deploy-notify

Deploy to Cloudflare Workers with automatic deployment notifications. This package wraps wrangler deploy and sends deployment information to a notification service.

Features

  • 🚀 Wraps wrangler deploy with all its options
  • 📤 Sends deployment notifications with git information
  • 🔧 Configurable via CLI arguments or environment variables
  • 📦 Can be used as a CLI tool or programmatically
  • 🎯 Automatic git information extraction
  • ⚡ Zero configuration needed (uses env vars)

Installation

# Global installation
npm install -g wrangler-deploy-notify

# Or as a dev dependency
npm install --save-dev wrangler-deploy-notify

Quick Start

Using Environment Variables

# Set up once
export DEPLOY_NOTIFY_URL=https://deploy-notify.your-domain.workers.dev
export TELEGRAM_BOT_TOKEN=your-telegram-bot-token
export TELEGRAM_CHAT_ID=your-telegram-chat-id

# Deploy with automatic notifications
wrangler-deploy-notify

Using CLI Arguments

wrangler-deploy-notify \
  --notify-url https://deploy-notify.your-domain.workers.dev \
  --telegram-bot-token your-telegram-bot-token \
  --telegram-chat-id your-telegram-chat-id \
  --env production

Short Command Alias

The package also provides a shorter wdn command:

wdn --env production

CLI Options

All standard wrangler deploy options are supported, plus:

| Option | Description | |--------|-------------| | --notify-url <url> | URL of the deployment notification service | | --telegram-bot-token <token> | Telegram bot token for notifications | | --telegram-chat-id <id> | Telegram chat ID for notifications | | --skip-notification | Skip sending notification | | --project-name <name> | Override project name detection | | --tag <tag> | Add a tag to the deployment | | --verbose | Show verbose output |

Wrangler Options

| Option | Description | |--------|-------------| | --env <environment> | Environment to deploy to | | --dry-run | Build but don't deploy | | --compatibility-date <date> | Compatibility date | | --compatibility-flags <flag> | Compatibility flags (repeatable) | | --config <path> | Path to wrangler config file | | --var <key:value> | Variables to pass to deployment |

Programmatic Usage

import { deployWithNotification } from 'wrangler-deploy-notify';

await deployWithNotification({
  notifyUrl: 'https://deploy-notify.your-domain.workers.dev',
  telegramBotToken: 'your-telegram-bot-token',
  telegramChatId: 'your-telegram-chat-id',
  env: 'production',
  vars: {
    API_KEY: 'secret123',
    DEBUG: 'true'
  }
});

Package.json Scripts

Add to your package.json:

{
  "scripts": {
    "deploy": "wrangler-deploy-notify",
    "deploy:staging": "wrangler-deploy-notify --env staging",
    "deploy:production": "wrangler-deploy-notify --env production --tag v$npm_package_version"
  }
}

GitHub Actions Example

name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      
      - name: Install dependencies
        run: npm ci
      
      - name: Deploy with notifications
        env:
          CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          DEPLOY_NOTIFY_URL: ${{ secrets.DEPLOY_NOTIFY_URL }}
          TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
          TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
        run: npx wrangler-deploy-notify --env production

What Gets Sent

The notification includes:

  • Project name (auto-detected from package.json or wrangler.toml)
  • Git branch
  • Git commit hash (full)
  • Git commit message (full, including multi-line)
  • Author email
  • Timestamp
  • Environment
  • Tag (if specified)
  • CI detection

Example notification payload:

{
  "deployment": {
    "type": "worker",
    "projectName": "my-api",
    "deploymentId": "deploy-1234567890",
    "branch": "main",
    "commitHash": "abc123def456789...",
    "commitMessage": "Add user authentication\n\nImplemented JWT tokens...",
    "author": "[email protected]",
    "timestamp": "2025-01-15T10:30:00Z",
    "environment": "production",
    "tag": "v1.2.3",
    "isCI": true,
    "telegramBotToken": "your-telegram-bot-token",
    "telegramChatId": "your-telegram-chat-id"
  }
}

Configuration

Environment Variables

| Variable | Description | |----------|-------------| | DEPLOY_NOTIFY_URL | Default notification service URL | | TELEGRAM_BOT_TOKEN | Telegram bot token for notifications | | TELEGRAM_CHAT_ID | Telegram chat ID for notifications | | CLOUDFLARE_API_TOKEN | Cloudflare API token (for wrangler) |

Auto-Detection

The package automatically detects:

  • Project name from (in order):

    1. --project-name argument
    2. package.json name field
    3. wrangler.toml name field
    4. CLOUDFLARE_PROJECT_NAME env var
  • Git information using git commands

  • CI environment from CI or WORKERS_CI env vars

Error Handling

  • Deployment failures will exit with code 1
  • Notification failures will log a warning but won't fail the deployment
  • Git detection failures will use fallback values

License

MIT