# sync-loop

> Run a sync loop with async functions

Latest version **0.1.1** (published 2017-04-27) · GNU General Public License v3.0 license · 0 weekly downloads

## Install

```sh
npm install sync-loop
pnpm add sync-loop
yarn add sync-loop
bun add sync-loop
```

## 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.1 |
| Published | 2017-04-27 |
| First published | 2017-04-27 |
| Weekly downloads | 0 |
| License | GNU General Public License v3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Nguyen Kim Kha |
| Maintainers | kimkha |

## Links

- npm: https://www.npmjs.com/package/sync-loop
- Repository: https://github.com/kimkha/sync-loop
- Homepage: https://github.com/kimkha/sync-loop#readme
- Issues: https://github.com/kimkha/sync-loop/issues
- npm.io page: https://npm.io/package/sync-loop

## Recent versions

- 0.1.1 (latest) — 2017-04-27
- 0.1.0 — 2017-04-27

## README

# sync-loop
Run a sync loop with async functions

## How to use

### Install
```bash
npm install sync-loop
```

### Import and use
```javascript
var syncLoop = require('sync-loop');
var numberOfLoop = 10;
syncLoop(numberOfLoop, function (loop) {
  // loop body
  var index = loop.iteration(); // index of loop, value from 0 to (numberOfLoop - 1)
  doAsyncJob(function(){
    // This is callback of your function
    loop.next(); // call `loop.next()` for next iteration
  })
}, function () {
  console.log("This is finish function")
});
```

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