# co-web-worker

> Cross-origin Web Workers

Latest version **1.0.1** (published 2018-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install co-web-worker
pnpm add co-web-worker
yarn add co-web-worker
bun add co-web-worker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-07-01 |
| First published | 2017-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Neek Sandhu |
| Maintainers | sweetslush |
| Keywords | same, domain, cross, origin, web, worker, proxy, cors |

## Links

- npm: https://www.npmjs.com/package/co-web-worker
- Repository: https://github.com/NeekSandhu/co-web-worker
- Homepage: https://github.com/NeekSandhu/co-web-worker#readme
- Issues: https://github.com/NeekSandhu/co-web-worker/issues
- npm.io page: https://npm.io/package/co-web-worker

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

- 1.0.1 (latest) — 2018-07-01
- 1.0.0 — 2017-12-21

## README

# Cross-origin web workers

## What???

If a site is on domain `https://abc.com` and wants to run a web worker located at `https://xyz.com/dist/worker.js`, it won't work.

Cross-origin web workers are not allowed.

So what can be done to get a worker at `xyz.com` run on `abc.com`?

Say no more.

### Install

```bash
$ npm i co-web-worker
```

### Light it up

```javascript
import CrossOriginWorker from 'co-web-worker';

console.log(window.location.origin);
// > https://abc.com

const worker = new CrossOriginWorker('https://xyz.com/dist/worker.js');

console.log(worker instanceof Worker);
// > true

```

## License

Licensed under MIT license. See `LICENSE` at root of this repo for more information.

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