# step-promise-looper

> Simple looping mechanism that steps through an array of Promises.

Latest version **0.0.12** (published 2025-10-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install step-promise-looper
pnpm add step-promise-looper
yarn add step-promise-looper
bun add step-promise-looper
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2025-10-17 |
| First published | 2019-07-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jaques Horn |
| Maintainers | acidspud |
| Keywords | promise, loop |

## Links

- npm: https://www.npmjs.com/package/step-promise-looper
- Repository: https://github.com/acidspud/step-promise-looper
- Homepage: https://github.com/acidspud/step-promise-looper#readme
- Issues: https://github.com/acidspud/step-promise-looper/issues
- npm.io page: https://npm.io/package/step-promise-looper

## 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.0.12 (latest) — 2025-10-17
- 0.0.10 — 2025-10-17
- 0.0.5 — 2019-07-15
- 0.0.3 — 2019-07-09

## README

# step-promise-looper
Simple looping mechanism that steps through an array of Promises.

## Install:
```
npm install step-promise-looper --save
```

## Initialize:

```
const stepPromiseLooper = require('step-promise-looper')
```

## Create some steps:
Array of promises

```
const looper = stepPromiseLooper({
  steps: [
    (result) => {
      console.log('step 1')
      return Promise.resolve('step 1')
    },
    (result) => {
      console.log('step 2')
      return new Promise(resolve => {
        setTimeout(() => {
          console.log('timeout')
          resolve('timeout')
        }, 5000)
      })
    }
  ]
})

```

## Control it:

```
// start the loop
looper.start();

// run through the steps only once
looper.runOnce()

// force the loop to stop.
looper.stop()

// gracefully stop the loop on the last step.
looper.stopAtEnd()

```

### Try It
* Visit the module at [npmjs.com](https://www.npmjs.com/package/step-promise-looper)

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