# lws-cors

> Support for setting Cross-Origin Resource Sharing (CORS) headers to lws

Latest version **4.2.1** (published 2024-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install lws-cors
pnpm add lws-cors
yarn add lws-cors
bun add lws-cors
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.2.1 |
| Published | 2024-01-08 |
| First published | 2017-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12.17 |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lloyd Brookes |
| Maintainers | 75lb |
| Keywords | lws, lws-middleware, cors |

## Links

- npm: https://www.npmjs.com/package/lws-cors
- Repository: https://github.com/lwsjs/cors
- Homepage: https://github.com/lwsjs/cors#readme
- Issues: https://github.com/lwsjs/cors/issues
- npm.io page: https://npm.io/package/lws-cors

## Dependencies (1)

- [@koa/cors](https://npm.io/package/@koa/cors.md) ^5.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 4.2.1 (latest) — 2024-01-08
- 4.2.0 — 2023-02-07
- 4.1.2 — 2022-03-14
- 4.1.1 — 2022-03-13
- 4.1.0 — 2022-03-13
- 3.1.1 — 2022-02-16
- 4.0.0 — 2022-02-16
- 3.1.0 — 2022-02-16
- 3.0.0 — 2020-02-09
- 2.0.1 — 2019-06-09
- 2.0.0 — 2019-06-03
- 1.0.0 — 2017-11-02
- 0.3.5 — 2017-07-09
- 0.3.4 — 2017-07-08
- 0.3.3 — 2017-07-08
- … 5 more at https://npm.io/package/lws-cors/versions

## README

[![view on npm](https://badgen.net/npm/v/lws-cors)](https://www.npmjs.org/package/lws-cors)
[![npm module downloads](https://badgen.net/npm/dt/lws-cors)](https://www.npmjs.org/package/lws-cors)
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/lwsjs/cors)](https://github.com/lwsjs/cors/network/dependents?dependent_type=REPOSITORY)
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/lwsjs/cors)](https://github.com/lwsjs/cors/network/dependents?dependent_type=PACKAGE)
[![Node.js CI](https://github.com/lwsjs/cors/actions/workflows/node.js.yml/badge.svg)](https://github.com/lwsjs/cors/actions/workflows/node.js.yml)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)

# lws-cors

Support for setting Cross-Origin Resource Sharing (CORS) headers to lws. Wraps [@koajs/cors](https://github.com/koajs/cors). For usage instructions, see [here](https://github.com/lwsjs/local-web-server/wiki/How-to-configure-Cross-Origin-Resource-Sharing-(CORS)).

Adds the following options to lws.

```
--cors.origin string             Set a `Access-Control-Allow-Origin` value. Default is the request Origin
                                 header.
--cors.allow-methods string      Set a `Access-Control-Allow-Methods` value. Default is
                                 "GET,HEAD,PUT,POST,DELETE,PATCH"
--cors.credentials               Set this flag to add `Access-Control-Allow-Credentials` header.
--cors.opener-policy string      Set a value for the `Cross-Origin-Opener-Policy` header (specify `unsafe-
                                 none`, same-origin-allow-popups` or `same-origin`).
--cors.embedder-policy string    Set a value for the `Cross-Origin-Embedder-Policy` header (specify `unsafe-
                                 none` or `require-corp`).
--cors.private-network-access    Set this flag to enable `Access-Control-Request-Private-Network` support.
```

* * *

&copy; 2016-23 Lloyd Brookes \<75pound@gmail.com\>.

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