Socket
Book a DemoInstallSign in
Socket

hono-adapter-aws-lambda

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono-adapter-aws-lambda

[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![Codecov][codecov-src]][codecov-href] [![Bundlejs][bundlejs-src]][bundlejs-href] [![jsDocs.io][jsDocs-src]][jsDocs-href]

1.3.3
latest
Source
npmnpm
Version published
Weekly downloads
41
64%
Maintainers
1
Weekly downloads
 
Created
Source

hono-adapter-aws-lambda TypeScript heart icon

npm version npm downloads Codecov Bundlejs jsDocs.io

hono-adapter-aws-lambda is a fork of hono's aws-lambda adapter, experimenting and adding some extra features

Features, Changes & Roadmap

  • Codebase is refactored quite a bit.
  • Add routing support for trigger events.
    • I.e, support for S3, SQS, etc. triggers, which would also support a simpler cross-function call interface.

    • Multiple routes on the same eventSource support.
    • Uses a factory pattern, the internal trigger context (middlewares, env bindings) is decoupled from the main Hono app.
    • See #10 for more information.
  • Support returning a Lambda response result directly, useful for returning the response of another invoked function.

Usage

Install package:

# pnpm (recommended)
pnpm install hono-adapter-aws-lambda

Import:

// ESM
import { handle, streamHandle } from 'hono-adapter-aws-lambda'

Examples:

Fast example of accepting an S3 trigger event

import type { S3Event } from 'aws-lambda' // You need to install `@types/aws-lambda`
import { createTriggerFactory, handle, streamHandle } from 'hono-adapter-aws-lambda'

interface Bindings {
  event: { Records: Array<{ eventName: string }> }
}
const app = new Hono<{ Bindings: Bindings }>()
const triggerFactory = createTriggerFactory(app)

triggerFactory.on('aws:s3', '$!', c => c.text((c.env.event as S3Event).Records[0].eventName))

See some more examples in the test file: test/index.test.ts

License

MIT License © 2024 NamesMT

Keywords

hono

FAQs

Package last updated on 01 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.