# @types/koa-cors

> TypeScript definitions for koa-cors

Latest version **0.0.6** (published 2023-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/koa-cors
pnpm add @types/koa-cors
yarn add @types/koa-cors
bun add @types/koa-cors
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2023-11-21 |
| First published | 2018-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/koa-cors
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-cors
- npm.io page: https://npm.io/package/@types/koa-cors

## Dependencies (1)

- [@types/koa](https://npm.io/package/@types/koa.md) *

## Recent versions

- 0.0.6 (latest) — 2023-11-21
- 0.0.2 (ts3.6) — 2021-07-20
- 0.0.0 (ts2.3) — 2018-08-25
- 0.0.5 — 2023-11-07
- 0.0.4 — 2023-10-18
- 0.0.3 — 2023-09-14
- 0.0.1 — 2021-07-08

## README

# Installation
> `npm install --save @types/koa-cors`

# Summary
This package contains type definitions for koa-cors (https://github.com/evert0n/koa-cors).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-cors.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-cors/index.d.ts)
````ts
import { Context, Middleware, Request } from "koa";

declare function koaCors(options?: koaCors.Options): Middleware;

declare namespace koaCors {
    interface Options {
        credentials?: true | ((ctx: Context) => boolean) | undefined;
        expose?: string | readonly string[] | undefined;
        headers?: string | readonly string[] | undefined;
        maxAge?: number | undefined;
        methods?: string | readonly string[] | undefined;
        origin?: boolean | string | ((request: Request) => string) | undefined;
    }
}

export = koaCors;

````

### Additional Details
 * Last updated: Mon, 20 Nov 2023 23:36:24 GMT
 * Dependencies: [@types/koa](https://npmjs.com/package/@types/koa)

# Credits
These definitions were written by [Romain Faust](https://github.com/romain-faust).

---
_Source: https://npm.io/package/@types/koa-cors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
