# @types/koa-ejs

> TypeScript definitions for koa-ejs

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

## Install

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

## 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.3.3 |
| Published | 2023-11-07 |
| First published | 2019-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

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

## Dependencies (2)

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

## Recent versions

- 4.3.3 (latest) — 2023-11-07
- 4.3.0 (ts3.7) — 2021-09-13
- 4.2.4 (ts3.6) — 2021-08-13
- 4.2.2 (ts2.8) — 2020-02-19
- 4.2.0 (ts2.3) — 2019-08-28
- 4.3.2 — 2023-10-18
- 4.3.1 — 2023-09-14
- 4.2.3 — 2021-07-08
- 4.2.1 — 2020-02-10

## README

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

declare module "Koa" {
    interface ExtendableContext {
        /** Properties values can be of any format; e.g. string, number, boolean, or even nested objects of these types */
        render: (template: string, properties?: { [name: string]: any }) => Promise<string>;
    }
}

/**
 *  Adds render method to the app context.
 */
declare function koaEjs(app: Koa, settings: koaEjs.Settings): void;

declare namespace koaEjs {
    interface Settings {
        /** View root directory */
        root: string;
        /** Global layout file, default is layout, set false to disable layout. */
        layout?: string | false;
        /** Filename extension for the views. Defaults to html. */
        viewExt?: string;
        /** Cache compiled templates */
        cache?: boolean;
        /** Log debug messages. */
        debug?: boolean;
        /** Character to use with angle brackets for open / close (default %). */
        delimiter?: string;
        /** When true, EJS will use an async function for rendering. Depends on async/await support in the JS runtime */
        async?: boolean;
        /** When false, EJS  will only return the HTML, not write to the resposne. Defaults to true */
        writeResp?: boolean;
    }

    /**
     * The ejs API.
     */
    const ejs: typeof Ejs;
}

export = koaEjs;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: [@types/ejs](https://npmjs.com/package/@types/ejs), [@types/koa](https://npmjs.com/package/@types/koa)

# Credits
These definitions were written by [Matt B](https://github.com/mattb-prg).

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