# @types/koa-send

> TypeScript definitions for koa-send

Latest version **4.1.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

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

## 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.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.1.6 |
| Published | 2023-11-07 |
| First published | 2016-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 4.1.6 (latest) — 2023-11-07
- 4.1.3 (ts3.6) — 2021-07-06
- 4.1.2 (ts2.3) — 2019-03-05
- 3.3.0 (ts2.0) — 2017-01-10
- 4.1.5 — 2023-10-18
- 4.1.4 — 2023-09-14
- 4.1.1 — 2017-12-28
- 4.1.0 — 2017-12-06
- 3.3.1 — 2017-11-09
- 3.0.1 — 2016-10-25

## README

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

import { Stats } from "fs";

declare function send(ctx: ParameterizedContext, path: string, opts?: send.SendOptions): Promise<string>;

declare namespace send {
    type SetHeaders = (res: ParameterizedContext["res"], path: string, stats: Stats) => any;

    interface SendOptions {
        /** Browser cache max-age in milliseconds. (defaults to 0) */
        maxage?: number | undefined;
        maxAge?: SendOptions["maxage"] | undefined;
        /** Tell the browser the resource is immutable and can be cached indefinitely. (defaults to false) */
        immutable?: boolean | undefined;
        /** Allow transfer of hidden files. (defaults to false) */
        hidden?: boolean | undefined;
        /** Root directory to restrict file access. (defaults to '') */
        root?: string | undefined;
        /** Name of the index file to serve automatically when visiting the root location. (defaults to none) */
        index?: string | false | undefined;
        /** Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. (defaults to true). */
        gzip?: boolean | undefined;
        /** Try to serve the brotli version of a file automatically when brotli is supported by a client and if the requested file with .br extension exists. (defaults to true). */
        brotli?: boolean | undefined;
        /** If not false (defaults to true), format the path to serve static file servers and not require a trailing slash for directories, so that you can do both /directory and /directory/. */
        format?: boolean | undefined;
        /** Function to set custom headers on response. */
        setHeaders?: SetHeaders | undefined;
        /** Try to match extensions from passed array to search for file when no extension is sufficed in URL. First found is served. (defaults to false) */
        extensions?: string[] | false | undefined;
    }
}

export = send;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: [@types/koa](https://npmjs.com/package/@types/koa)

# Credits
These definitions were written by [Peter Safranek](https://github.com/pe8ter), and [Tomek Łaziuk](https://github.com/tlaziuk).

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