# co-thread

> spawn multiple co 'threads'

Latest version **0.0.1** (published 2014-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install co-thread
pnpm add co-thread
yarn add co-thread
bun add co-thread
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-02-01 |
| First published | 2014-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Maintainers | tjholowaychuk |
| Keywords | co, thread, parallel |

## Links

- npm: https://www.npmjs.com/package/co-thread
- Repository: https://github.com/visionmedia/co-thread
- Issues: https://github.com/visionmedia/co-thread/issues
- npm.io page: https://npm.io/package/co-thread

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2014-02-01

## README

# co-thread

  Run a generator function in parallel N times.

## Installation

```
$ npm install co-thread
```

## Example

  Send requests in batches of `20`:

```js
var thread = require('co-thread');
var get = require('co-request');
var co = require('co');

co(function *(){
  var times = 10;

  while (times--) {
    yield thread(function *(){
      var a = yield get('http://google.com');
      console.log(a.statusCode);

      var b = yield get('http://yahoo.com');
      console.log(b.statusCode);
    }, 20);
  }
})();
```

## License

  MIT

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