Skip to main content
Home
This release is 7 versions behind 17.1.4 — the latest version of @oak/oak. Jump to latest

@oak/oak@16.0.0
Built and signed on GitHub Actions

A middleware framework for handling HTTP with Deno, Node.js, Bun and Cloudflare Workers 🐿️🦕🥟⚙️

This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
94%
Published
a year ago (16.0.0)

Contains the core concept of oak, the middleware application. Typical usage is the creation of an application instance, registration of middleware, and then starting to listen for requests.

Example

import { Application } from "jsr:@oak/oak@14/application";

const app = new Application();
app.use((ctx) => {
  ctx.response.body = "hello world!";
});

app.listen({ port: 8080 });

Classes

c
Application

A class which registers middleware (via .use()) and then processes inbound requests against that middleware (via .listen()).

c
ApplicationCloseEvent

An event that occurs when the application closes.

c
ApplicationErrorEvent

An event that occurs when an application error occurs.

c
ApplicationListenEvent

An event that occurs when the application starts listening for requests.

Interfaces

I
ListenOptionsBase

Base interface for application listening options.

Type Aliases

T
ListenOptions

Options which can be specified when listening.

T
ListenOptionsTls

Interface options when listening on TLS.

T
State

The base type of state which is associated with an application or context.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@oak/oak

Import symbol

import * as mod from "@oak/oak/application";
or

Import directly with a jsr specifier

import * as mod from "jsr:@oak/oak/application";

Add Package

pnpm i jsr:@oak/oak
or (using pnpm 10.8 or older)
pnpm dlx jsr add @oak/oak

Import symbol

import * as mod from "@oak/oak/application";

Add Package

yarn add jsr:@oak/oak
or (using Yarn 4.8 or older)
yarn dlx jsr add @oak/oak

Import symbol

import * as mod from "@oak/oak/application";

Add Package

npx jsr add @oak/oak

Import symbol

import * as mod from "@oak/oak/application";

Add Package

bunx jsr add @oak/oak

Import symbol

import * as mod from "@oak/oak/application";