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

opencode-waitfor

v0.1.1

Published

opencode plugin: a wait_for tool that polls HTTP/TCP/command targets until ready or timeout.

Readme

opencode-waitfor

A zero-dependency opencode plugin that adds a wait_for tool to poll HTTP, TCP, or shell command targets until they are ready or a timeout elapses.

Replaces the manual for i in $(seq 1 40); do sleep 3; curl ...; done polling loops that agents write by hand.

Install

Add "opencode-waitfor" to the plugin array in your opencode.json:

{
  "plugin": ["opencode-waitfor"]
}

Then restart opencode.

Tool: wait_for

Poll a target until it meets a readiness condition or the timeout expires. The condition type is inferred from target:

| target pattern | Condition type | |---|---| | Contains :// (e.g. http://localhost:3000) | HTTP | | Bare host:port (e.g. localhost:5432) | TCP | | Anything else | Shell command |

Args

| Arg | Type | Default | Description | |---|---|---|---| | target | string | (required) | URL (with scheme), host:port, or shell command | | timeout | number | 60 | Total seconds to wait | | interval | number | 2 | Seconds between attempts | | expect.status | number | number[] | any 2xx | HTTP only — acceptable status code(s) | | expect.json_match | {path: value} | — | HTTP only — dot-path → expected value (compared as strings) | | expect.exit_code | number | 0 | Command only — required exit code |

Result

Returns { title, output, metadata } with metadata.{ success, type, target, elapsed_seconds, attempts, last, reason? }.

On timeout, metadata.success is false, metadata.reason is "timeout", and metadata.last contains the final probe's state (last HTTP status + body, last command exit + output, etc.) — enough to diagnose the failure without re-probing.

Invalid inputs (e.g. interval > timeout, expect.exit_code on an HTTP target) throw an error immediately.

Examples

Wait for a dev server

wait_for http://localhost:3000

Deploy verify — health endpoint version check

After deploying commit abc123:

wait_for http://host/api/health
  timeout 30 interval 3
  expect { json_match: { status: ok, version: abc123 } }

Wait for a database port

wait_for localhost:5432
  timeout 10

Wait for Docker container health

wait_for 'docker inspect -f "{{.State.Health.Status}}" pg | grep -q healthy'
  timeout 60 interval 5

Sharp edges

  • HTTP targets MUST include the scheme (http:// or https://). A schemeless URL like localhost:3000/health is treated as a shell command (and will fail to run).
  • json_match compares stringified values only — no deep equality, numeric comparison, or regex. Exact string match.
  • command runs through the shell and inherits the agent's environment/cwd. The caller is responsible for command safety.

License

MIT