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

@mayurajs/deploy-cloudflare

v1.2.0

Published

Cloudflare as a mayura deploy target: the app in Containers, or the serverless module on Workers, with wrangler.

Readme

@mayurajs/deploy-cloudflare

Cloudflare as a mayura deploy target, with wrangler, in two forms:

  • Containers (the default) run your Mayura app module, as on any container platform;
  • Workers run the serverless module at the edge.
npm install --save-dev @mayurajs/deploy-cloudflare wrangler
npm install @cloudflare/containers                 # Containers only
wrangler secret put DATABASE_URL                   # and each variable in env
mayura deploy init --target cloudflare --apply
mayura deploy --target cloudflare                  # prints the plan and its digest
DATABASE_URL=… mayura deploy --target cloudflare --apply --confirm <digest>

Containers

deploy init writes:

  • wrangler.jsonc, with two Durable-Object-backed container classes:
    • MayuraServer, the image's serve, spread across up to maxInstances instances;
    • MayuraWorker, deploy/cloudflare/worker.Dockerfile, the same build with the worker command.
  • deploy/cloudflare/worker.js, the Worker in front:
    • sends /v1/* to a server container, and answers anything else with 404;
    • gives both containers DATABASE_URL and each name in env from the Worker's secrets;
    • on a cron trigger every minute, requests the worker container's /readyz, which starts it if it slept and keeps it awake.

A release:

  1. Checks the wrangler login.
  2. Builds the project and migrates storage from your machine, with the DATABASE_URL in your environment, since Containers have no pre-deploy step.
  3. Runs wrangler deploy, which builds and pushes the images and updates the Worker and its containers.

Workers

Set targets.cloudflare.runtime to workers. Your serverless module (src/mayura.ts, as in the deployment guide) exports handle(request, env) and advanceWorkflows(budgetMs, env); env carries bindings such as D1 or Hyperdrive. Storage initializes itself on first use (await ready), under the schema lock.

deploy init writes:

  • wrangler.jsonc, with nodejs_compat and a cron every minute;
  • deploy/cloudflare/worker.ts: fetch calls handle, and the cron calls advanceWorkflows within 20 seconds.

A release checks the login and runs wrangler deploy, which bundles your TypeScript.

Settings

In mayura.deploy.json under targets.cloudflare:

  • runtime;
  • name (the project name);
  • maxInstances (3);
  • module (src/mayura.ts, Workers);
  • cron (true).

Secrets set with wrangler secret put are never deleted by a deploy. wrangler uses its own login, or CLOUDFLARE_API_TOKEN in CI; Mayura reads neither. On Windows wrangler is a .cmd script, which mayura deploy runs through cmd.exe with checked, quoted arguments.

See Deploy with mayura deploy. Apache-2.0.