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

@glandjs/hono

v1.0.0

Published

The Hono adapter for Gland's HTTP layer, for Node and for the edge runtimes Hono targets.

Readme

Description

@glandjs/hono is the Hono adapter for Gland's HTTP layer. Because Hono is built on the Fetch API, this is the only adapter that also runs on Cloudflare Workers, Deno Deploy, Bun and Lambda — where there is no socket to bind and the application exports fetch instead.

The same controller, the same middleware and the same reply semantics run on all of them.

Install

npm install @glandjs/core @glandjs/common @glandjs/http @glandjs/hono reflect-metadata

Optional, for listen() on Node: @hono/node-server.

Usage

On Node:

import { GlandFactory } from '@glandjs/core';
import { HonoBroker, type HonoRequestContext } from '@glandjs/hono';
import { Get } from '@glandjs/http';
import { Controller, Module } from '@glandjs/common';

@Controller('/products')
class ProductController {
  @Get('/:id')
  async find(ctx: HonoRequestContext) {
    return ctx.call('db:product:find', ctx.params.id);
  }
}

@Module({ controllers: [ProductController] })
class AppModule {}

const { app, shutdown } = await GlandFactory.create(AppModule);
const http = app.connectTo(HonoBroker);

http.listen(3000);
await http.ready();

On an edge runtime, export the Hono instance:

export default http.hono; // Cloudflare Workers, Deno, Bun

A fetch Response is immutable

This is the trade for running everywhere, and it has three consequences.

c.res is replaced, not mutated. A useRaw middleware that sets a header is merged into the adapter's reply rather than overwriting it, so c.header('x-request-id', …) still reaches the client. What it cannot do is change the status or the body: a fetch Response is immutable, and the adapter's is the one the handler's return value describes. A raw middleware can observe, add headers, and short-circuit by returning its own Response.

No raw body. A fetch body is read as text, and re-buffering it would mean holding the whole body twice. The adapter warns at boot and ctx.rawText carries what was read. For a file upload, use await ctx.req.parseBody() in the handler.

listen() is Node-only. On an edge runtime there is nothing to bind, and the adapter says so rather than failing.

The body is read once

A fetch Request body is a one-shot stream, so the adapter reads it in a middleware and hands the parsed value to ctx.body. Without that, ctx.body would be undefined everywhere — and a second read would hang rather than return nothing.

app.useRaw(async (c, next) => {
  c.header('x-request-id', crypto.randomUUID());
  await next();
});

API

| Export | Kind | | ------------------------------------------------------- | ------------------------------------------- | | HonoBroker / HonoBrokerClass | What app.connectTo() takes | | HonoCore | The application, with a typed hono getter | | HonoAdapter | The adapter | | HonoRequestContext, FetchBodyInit, parseFetchBody | The context |

The full surface is in the API reference.

Documentation

License

MIT