# @types/restify-cors-middleware

> TypeScript definitions for restify-cors-middleware

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

## Install

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

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

## Links

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

## Dependencies (2)

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

## Recent versions

- 1.0.5 (latest) — 2023-11-07
- 1.0.2 (ts3.6) — 2021-07-08
- 1.0.1 (ts2.3) — 2017-10-25
- 1.0.4 — 2023-10-18
- 1.0.3 — 2023-09-27
- 1.0.0 — 2017-07-07

## README

# Installation
> `npm install --save @types/restify-cors-middleware`

# Summary
This package contains type definitions for restify-cors-middleware (https://github.com/TabDigital/restify-cors-middleware).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/restify-cors-middleware.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/restify-cors-middleware/index.d.ts)
````ts
/// <reference types="node" />

import { RequestHandler } from "restify";

declare namespace corsMiddleware {
    interface Options {
        /**
         * an array of whitelisted origins
         * can be both strings and regular expressions
         */
        origins: Array<string | RegExp>;
        /** user defined headers to allow */
        allowHeaders: string[];
        /** user defined headers to expose */
        exposeHeaders: string[];
        /** if true, uses creds */
        credentials?: boolean | undefined;
        /** ms to cache preflight requests */
        preflightMaxAge?: number | undefined;
        /** customize preflight request handling */
        preflightStrategy?: any;
    }

    interface CorsMiddleware {
        actual: RequestHandler;
        preflight: RequestHandler;
    }
}

declare function corsMiddleware(options: corsMiddleware.Options): corsMiddleware.CorsMiddleware;
export = corsMiddleware;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/restify](https://npmjs.com/package/@types/restify)

# Credits
These definitions were written by [Daniel Thunell](https://github.com/dthunell).

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