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

hono-openwhisk-adapter

v2.0.1

Published

[Hono](https://hono.dev/) adapter for OpenWhisk. Build [OpenWhisk Actions](https://github.com/apache/openwhisk/blob/master/docs/webactions.md) (or [Adobe App Builder Actions](https://developer.adobe.com/app-builder/docs/guides/runtime_guides/creating-acti

Downloads

311

Readme

hono-openwhisk-adapter

Hono adapter for OpenWhisk. Build OpenWhisk Actions (or Adobe App Builder Actions) using Hono. Params are passed in c.env.params; optional validation is supported via a validator function (use any library: Zod, ArkType, Standard Schema, etc.).

Installation

npm install hono-openwhisk-adapter hono

For runtime validation, install any schema/validation library you like (e.g. Zod, ArkType).

How to use

Setting raw-http: true

[!IMPORTANT] This is essential for the hono adapter to work.

Your action must use the raw-http: true annotation or the web: raw annotation so the adapter receives the raw HTTP params.

On Adobe App Builder, set it in your *.config.yaml:

application:
  runtimeManifest:
    packages:
      my-package:
        actions:
          my-action:
            function: actions/my-action.ts
            web: "yes"
            runtime: nodejs:22
            annotations:
              raw-http: true
              web-export: raw
            inputs:
              MY_VAR_ONE: $ENV_VAR_ONE
              MY_VAR_TWO: $ENV_VAR_TWO

Basic usage

import { Hono } from "hono";
import { ToOpenWhiskAction } from "hono-openwhisk-adapter";

const app = new Hono();
app.get("/hello", (c) => c.text("Hello"));
app.get("/*", (c) => c.text("Fallback"));

export const main = ToOpenWhiskAction(app);

Params in context (c.env.params)

The original Action params (including __ow_path, __ow_method, ...etc) are available as c.env.params. Use the OwEnv type for typed params.

Example: in the sample yaml above, there are two inputs: MY_VAR_ONE and MY_VAR_TWO. which will be available in c.env.params:

import { Hono } from "hono";
import { ToOpenWhiskAction, type OwEnv, type OwRawHttpParams } from "hono-openwhisk-adapter";

// Params = Ow raw HTTP params + your own params (inputs in your *.config.yaml on Adobe App Builder)
type MyParams = OwRawHttpParams & {
  MY_VAR_ONE: string;
  MY_VAR_TWO: string;
};

const app = new Hono<OwEnv<MyParams>>();

app.get("/config", (c) => {
  return c.json({
    path: c.env.params.__ow_path,
    myVarOne: c.env.params.MY_VAR_ONE, // access to input params
    myVarTwo: c.env.params.MY_VAR_TWO, // access to input params
  });
});

export const main = ToOpenWhiskAction(app);

OwEnv<TParams> types c.env.params as TParams & OwRawHttpParams. Omit the generic for default OwRawHttpParams.

Validating Action Params

Pass a validator function as the second argument. It receives raw action params. Throw error on failure. You can use any library: Zod, ArkType, Standard Schema, etc.

when validation fails, the error is logged, and a generic 500 Internal Server Error: action params validation failed to avoid exposing private inputs.

With Zod (helper validator)

install zod npm install zod

Use zodOwParamsValidator to wrap a Zod schema; it validates params and throws on failure.

import { Hono } from "hono";
import { z } from "zod";
import { ToOpenWhiskAction, zodOwParamsValidator, type OwEnv } from "hono-openwhisk-adapter";

const ParamsSchema = z.object({
  MY_VAR_ONE: z.string().nonempty(),
  MY_VAR_TWO: z.string().nonempty(),
});

// Params type inferred from the Zod schema:
type Params = z.infer<typeof ParamsSchema>;

const app = new Hono<OwEnv<Params>>();

app.get("/me", (c) => c.json({ userId: c.env.params.userId }));

export const main = ToOpenWhiskAction(app, zodOwParamsValidator(ParamsSchema));

Routing

Path and routing

If your action is published at
https://workspace.adobeio-static.net/api/v1/web/my-package/my-action,
the path used for Hono routing is the segment after the action name:

https://workspace.adobeio-static.net/api/v1/web/my-package/my-action/pets/dragon/abilities
                                                                    |-------- path ------|

Example routes:

app.get("/pets", (c) => c.json({ count: pets.length, pets }));

app.get("/pets/:type", (c) => {
  const type = c.req.param("type").toLowerCase();
  return c.json(petStore[type] ?? { error: "Not found" }, 404);
});

app.get("/pets/:type/abilities", (c) => {
  const type = c.req.param("type");
  return c.json(getAbilities(type));
});

See Hono routing.


Motivation

OpenWhisk (and App Builder) actions use a custom input/output shape (__ow_* params, { statusCode, headers, body }). This adapter lets you write actions using the standard Fetch Request/Response model and Hono’s API, with TypeScript support and optional Zod validation.


Local development

  1. Clone this repo and build:

    npm run build
    npm link
  2. In your project:

    npm link hono-openwhisk-adapter

    Run npm run build in this repo after changes so the linked package is up to date.


Publishing to npm

Releases are automated with semantic-release via GitHub Actions. Use Conventional Commits:

  • feat: ... → minor
  • fix: ... → patch
  • feat!: ... or BREAKING CHANGE: → major