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

@wooksjs/h3-adapter

v0.7.0

Published

H3 Adapter for Wooks — use Wooks composables with H3

Downloads

32

Readme

@wooksjs/h3-adapter

Use Wooks composables with H3 — register Wooks-style route handlers on top of an existing H3 app. Unmatched requests automatically fall through to H3 handlers.

Install

npm install @wooksjs/h3-adapter @wooksjs/event-http wooks h3

Quick Start

import { H3, toNodeHandler } from 'h3/node'
import { WooksH3 } from '@wooksjs/h3-adapter'
import { useRouteParams } from '@wooksjs/event-http'
import { createServer } from 'http'

const app = new H3()
const wooks = new WooksH3(app)

wooks.get('/hello/:name', () => {
    const { get } = useRouteParams()
    return { hello: get('name') }
})

const handler = toNodeHandler(app)
createServer(handler).listen(3000, () => {
    console.log('Server running on http://localhost:3000')
})

Features

  • Full access to Wooks composables (useRequest, useRouteParams, useHeaders, useResponse, useCookies, useAuthorization, etc.)
  • All HTTP methods: get, post, put, patch, delete, head, options
  • Mixed routing — use Wooks routes and H3 routes side by side
  • Async handler support
  • Custom error handling with HttpError
  • Configurable 404 behavior

Composables

Access request data and control responses using Wooks composables — no handler arguments needed:

import {
    useRequest,
    useRouteParams,
    useHeaders,
    useResponse,
    useCookies,
    useAuthorization,
    useUrlParams,
    HttpError,
} from '@wooksjs/event-http'

Usage Examples

Route Parameters

wooks.get('/users/:id', () => {
    const { get } = useRouteParams()
    return { userId: get('id') }
})

Reading Request Body

wooks.post('/data', async () => {
    const { rawBody } = useRequest()
    const body = await rawBody()
    return { received: body.toString() }
})

Setting Response Headers

wooks.get('/custom-headers', () => {
    const response = useResponse()
    response.setHeader('x-powered-by', 'wooks')
    response.setStatus(200)
    return { ok: true }
})

Error Handling

wooks.get('/protected', () => {
    throw new HttpError(403, 'Forbidden')
})

Mixed Routing (Wooks + H3)

const app = new H3()
const wooks = new WooksH3(app)

// Wooks route — uses composables
wooks.get('/wooks-route', () => {
    const { get } = useRouteParams()
    return 'handled by wooks'
})

// H3 route — uses h3 event API
app.on('GET', '/h3-route', (event) => {
    return 'handled by h3'
})

Requests matching Wooks routes are handled by Wooks. Unmatched requests fall through to H3.

Options

const wooks = new WooksH3(app, {
    // Return 404 for unmatched routes instead of falling through to H3
    raise404: true,

    // Custom handler for unmatched routes
    onNotFound: () => {
        const response = useResponse()
        response.setStatus(404)
        return { error: 'not found' }
    },

    // Default response headers
    defaultHeaders: {
        'x-powered-by': 'wooks',
    },

    // Request body size limits
    requestLimits: {
        maxCompressed: 1_048_576,
        maxInflated: 10_485_760,
    },
})

Development

npm install        # Install dependencies
npm test           # Run tests (vitest)
npm run build      # Build (unbuild)
npm run lint       # Lint (oxlint)
npm run fmt        # Format (oxfmt)

License

MIT