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

@sawala/kodena

v0.7.1

Published

Deploy Cloudflare Worker bundles to Kodena from the terminal.

Downloads

2,544

Readme

@sawala/kodena

Deploy Cloudflare Worker bundles to Kodena from your terminal. Typically used to ship OpenNext-compiled Next.js apps, but works for any worker.js + assets bundle.

Install

Global:

npm i -g @sawala/kodena
kodena --version

One-off via npx:

npx @sawala/kodena --version

Requires Node ≥ 20.

Scaffold from a template

Don't have a project yet? Start from a curated Kodena template:

kodena template list               # see what's available
kodena init                        # pick one interactively + a target dir
kodena init landing-ssr ./my-site  # or scaffold a specific one non-interactively

cd my-site
npm install
kodena deploy --build              # the generated kodena.json is ready to deploy

kodena init downloads the chosen template's source from the public kodena-templates repo, writes it into the target directory, and generates a kodena.json so the very next kodena deploy works with no hand-editing. Omit the slug to choose from a list (the recommended template is pre-selected). Pass --ref <branch-or-tag> to scaffold from a specific version, --slug <name> to set the generated script slug, or --force to scaffold into a non-empty directory.

Only standalone templates (ones that deploy with no backend) are offered here. Templates that read content from a Kontena CMS project need that project provisioned first, so they're hidden from kodena init for now — they remain available through the hosted InstantPage site builder.

Quick start

cd path/to/your/next-app
kodena login                     # paste a CLI token from the dashboard
kodena org use <org-slug>        # if you belong to more than one org
kodena project use <project>    # pick the target project

# write a minimal kodena.json (see "Configuration" below):
echo '{"slug": "my-script"}' > kodena.json

npx @opennextjs/cloudflare build # produce .open-next/
kodena deploy

On success the CLI prints the live URL (https://<tenant>.kodena.id) and any custom hostname attached to the script.

Commands

| Command | What it does | | --- | --- | | kodena login | Prompt for a koda_… token, validate it against /me, and store credentials. Opens the dashboard in your browser by default; pass --no-browser to skip. | | kodena logout | Delete the local credentials file. Does not revoke the token server-side. | | kodena whoami | Print the identity, active org/project, token source, and token scope. | | kodena org list | List orgs you belong to. The active one is marked *. | | kodena org use <slug> | Set the active org. Validates membership before writing. | | kodena project list | List projects in the active org (first 100). | | kodena project use <slug> | Set the active project for the active org. | | kodena template list | List the starter templates you can scaffold with kodena init. | | kodena init [slug] [dir] | Scaffold a local project from a template (omit the slug to pick interactively). Generates a ready-to-deploy kodena.json. | | kodena deploy | Upload the bundle (worker.js + assets) described by kodena.json to the active org/project. Creates the script on first deploy. |

deploy flags

  • --slug <name> — override kodena.json's script slug.
  • --org <slug> / --project <slug> — one-shot override of the active context.
  • --token <koda_…> — use this token instead of the stored one.
  • --api-base <url> — override the API base URL.
  • --var KEY=value — set a worker var. Repeatable; merges with vars in kodena.json.
  • --compat-flag <flag>nodejs_compat or nodejs_als. Repeatable.
  • --compat-date <YYYY-MM-DD> — compatibility date.
  • --build / --no-build — run (or skip) kodena.json's build.command before uploading. Default npx @opennextjs/cloudflare build.
  • --dry-run — do everything up to the upload, then print a bundle summary.

Configuration

kodena.json (per project)

The CLI walks up from the current directory looking for kodena.json (or kodena.config.json). Minimal form:

{
  "slug": "my-script"
}

Full schema:

{
  "slug": "my-script",                         // required: Cloudflare script slug
  "name": "My script",                         // optional display name (≤ 64 chars)
  "project": "my-project",                     // optional: bind to a project slug
  "build": {
    "command": "npx @opennextjs/cloudflare build",
    "outputDir": ".open-next",                 // default
    "workerEntry": ".open-next/worker.js",     // default
    "assetsDir": ".open-next/assets",          // default
    "runByDefault": false                      // if true, `kodena deploy` builds first
  },
  "vars": { "MY_KEY": "value" },               // KEYS must match /^[A-Z][A-Z0-9_]*$/
  "compatibilityFlags": ["nodejs_compat"],
  "compatibilityDate": "2025-01-01"
}

Local state

The CLI stores state under ~/.kodena/ (override with KODENA_CONFIG_DIR):

  • ~/.kodena/credentials — token + API base. Written atomically with mode 0600.
  • ~/.kodena/configactiveOrg and activeProject. Mode 0644.

Environment variables

  • KODENA_API_BASE — override the API base URL (default https://api.sawala.cloud).
  • KODENA_PROJECT — override the active project for a single command.
  • KODENA_CONFIG_DIR — relocate the credentials + config directory.

Links

License

MIT — see LICENSE.