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

gpt-puppeteer

v1.0.0

Published

A Cloudflare Worker that uses Puppeteer to automate image generation with ChatGPT.

Readme

GPT Puppeteer

A Cloudflare Worker that uses Puppeteer to automate image generation with ChatGPT.

Features

  • HTTP API for submitting image generation requests
  • Queue-based processing for reliability
  • Support for uploading images or providing image URLs
  • Webhook notifications when images are ready
  • Local development with a real Chrome browser

Setup

Prerequisites

  • Node.js 18+
  • pnpm or npm
  • Cloudflare account with Workers and R2 enabled

Installation

# Install dependencies
pnpm install

Local Development

  1. Create a cookies.json file with your ChatGPT cookies (see cookies.json.example)
  2. Start the local development server:
pnpm dev:worker

This will launch a local server at http://localhost:8787 and use your local Chrome browser for processing.

Production Setup

  1. Set up the required Cloudflare resources:
# Create R2 buckets and queue
pnpm setup:all

# Or individually:
pnpm setup:buckets
pnpm setup:queue
  1. Upload your cookies to R2:
pnpm cookies:upload
  1. Deploy the worker:
pnpm publish

Usage

Submitting a Job

curl -X POST https://your-worker.workers.dev \
  -F "prompt=A beautiful sunset over mountains" \
  -F "webhook_url=https://your-webhook.com/callback"

You can also include an image:

curl -X POST https://your-worker.workers.dev \
  -F "prompt=Make this image more vibrant" \
  -F "[email protected]"

Or an image URL:

curl -X POST https://your-worker.workers.dev \
  -F "prompt=Make this image more vibrant" \
  -F "image_url=https://example.com/image.jpg"

Checking Job Status

curl https://your-worker.workers.dev/JOB_ID

Cookie Management

Downloading Cookies from Production

pnpm cookies:download

Uploading Cookies to Production

pnpm cookies:upload

Local Cookie Configuration

You can either:

  1. Create a cookies.json file in the project root
  2. Add your cookies to the .env file as CHATGPT_COOKIES

Development Commands

  • pnpm build: Build the TypeScript code
  • pnpm dev:worker: Run the worker locally with a real Chrome browser
  • pnpm dev:worker:remote: Run the worker on Cloudflare's edge (temporary deployment)
  • pnpm deploy: Deploy the worker to production
  • pnpm publish: Build and deploy the worker to production
  • pnpm cookies:upload: Upload local cookies.json to R2
  • pnpm cookies:download: Download cookies.json from R2
  • pnpm setup:buckets: Create R2 buckets
  • pnpm setup:queue: Create Cloudflare Queue
  • pnpm setup:all: Set up all required Cloudflare resources