# @types/koa-static-server

> TypeScript definitions for koa-static-server

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

## Install

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

## 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 | 1.5.3 |
| Published | 2023-11-07 |
| First published | 2018-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 1.5.3 (latest) — 2023-11-07
- 1.5.0 (ts3.7) — 2021-10-21
- 1.3.1 (ts3.6) — 2021-07-08
- 1.3.0 (ts2.3) — 2018-10-03
- 1.5.2 — 2023-10-18
- 1.5.1 — 2023-09-14

## README

# Installation
> `npm install --save @types/koa-static-server`

# Summary
This package contains type definitions for koa-static-server (https://github.com/pkoretic/koa-static-server).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-static-server.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-static-server/index.d.ts)
````ts
/* =================== USAGE ===================

    import serve = require("koa-static-server");
    var Koa = require('koa');

    var app = new Koa();
    app.use(serve(serve({rootDir: 'web'}));

 =============================================== */
import { Middleware } from "koa";

declare function KoaStaticServer(options: KoaStaticServer.Options): Middleware;

declare namespace KoaStaticServer {
    interface Options {
        /**
         * directory that is to be served
         */
        rootDir?: string | undefined;
        /**
         * optional rewrite path
         */
        rootPath?: string | undefined;
        /**
         * optional default file to serve if requested static is missing
         */
        notFoundFile?: string | undefined;
        /**
         * request access log to console
         */
        log?: boolean | undefined;
        /**
         * don't execute any downstream middleware. defaults to true
         */
        last?: boolean | undefined;
        /**
         * Browser cache max-age in milliseconds. defaults to 0
         */
        maxage?: number | undefined;
        /**
         * Allow transfer of hidden files. defaults to false
         */
        hidden?: boolean | undefined;
        /**
         * Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested
         */
        gzip?: boolean | undefined;
        /**
         * Try to serve the brotli version of a file automatically when brotli is supported by a client and in the requested
         */
        brotli?: boolean | undefined;
        index?: string | undefined;
    }
}

export = KoaStaticServer;

````

### 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 [wulunyi](https://github.com/wulunyi).

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