# sanic

> A fast coroutine generator that saves your memory

Latest version **0.1.0** (published 2017-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install sanic
pnpm add sanic
yarn add sanic
bun add sanic
```

## 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.1.0 |
| Published | 2017-05-24 |
| First published | 2017-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aurieh |
| Maintainers | aurieh |
| Keywords | coroutine, generator, ecma6, async |

## Links

- npm: https://www.npmjs.com/package/sanic
- Repository: https://github.com/aurieh/sanic
- Homepage: https://github.com/aurieh/sanic#readme
- Issues: https://github.com/aurieh/sanic/issues
- npm.io page: https://npm.io/package/sanic

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-05-24
- 0.0.2 — 2017-01-06
- 0.0.1 — 2017-01-06

## README

# Sanic - a coroutine wrapper
[![Build Status](https://travis-ci.com/aurieh/sanic.svg?token=EAx6eCrkYNcVTTEG4DY5&branch=master)](https://travis-ci.com/aurieh/sanic)

```js
const sanic = require("sanic");
var fn = sanic(function* () {
  try {
    const response = yield makeAWebRequest();
    console.log(response.body);
  } catch (e) {
    console.error("Wooops\n", e);
  }
});

fn();
```
Just like that, did I mention its fast? How fast, you may ask.. Well
```
sanic x 503,384 ops/sec ±0.60% (84 runs sampled)
babel x 450,866 ops/sec ±0.50% (88 runs sampled)
typescript x 436,633 ops/sec ±2.27% (83 runs sampled)
bluebird.coroutine x 7,969 ops/sec ±1.15% (84 runs sampled)
co.wrap x 386,493 ops/sec ±0.79% (83 runs sampled)
q.async x 25,756 ops/sec ±3.14% (79 runs sampled)
asyncawait x 159,716 ops/sec ±1.17% (85 runs sampled)
Fastest is sanic
```
And all that for a fraction of memory (benchmark runs used ~20MB, for sanic)

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