Socket
Book a DemoInstallSign in
Socket

hono-wait-until

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono-wait-until

[![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.0.1
latest
Source
npmnpm
Version published
Weekly downloads
12
33.33%
Maintainers
0
Weekly downloads
 
Created
Source

hono-wait-until TypeScript heart icon

npm version npm downloads Codecov Bundlejs jsDocs.io

hono-wait-until is a simple wrapper for wait-until-generalized, which "Fake waitUntil in AWS Lambda and other platforms that don't support it.".

It basically waits for all async tasks to complete before returning the response, so the platform won't kill your app with uncompleted async tasks.

Usage

Install package:

# npm
npm install hono-wait-until

# yarn
yarn add hono-wait-until

# pnpm (recommended)
pnpm install hono-wait-until

Import:

import type { WaitUntilList } from 'hono-wait-until'
import {
  waitUntil, // Optional helper function instead of accessing via context
  waitUntilMiddleware,
} from 'hono-wait-until'

const app = new Hono<{ Variables: { waitUntilList: WaitUntilList } }>()
  // Preferably, use the waitUntilMiddleware as early as you can.
  .use(waitUntilMiddleware())
  .get('/context', async (c) => {
    const waitUntilList = c.get('waitUntilList')
    waitUntilList.waitUntil(sleep(300))

    return c.text(`Using waitUntil via context variable`)
  })
  .get('/helper', async (c) => {
    waitUntil(sleep(300), c)

    return c.text(`Using waitUntil via helper function`)
  })

Roadmap

  • Become the legendary 10000x developer

License License

MIT License © 2025 NamesMT

FAQs

Package last updated on 18 Feb 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.