# list-cycler

> Inifinity cycle through list.

Latest version **1.0.0** (published 2016-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install list-cycler
pnpm add list-cycler
yarn add list-cycler
bun add list-cycler
```

## 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.0 |
| Published | 2016-05-03 |
| First published | 2013-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Marcin Sztolcman |
| Maintainers | mysz |
| Keywords | cycle, ring, round, robin |

## Links

- npm: https://www.npmjs.com/package/list-cycler
- Repository: https://github.com/msztolcman/node-list-cycler
- Homepage: https://github.com/msztolcman/node-list-cycler#readme
- Issues: https://github.com/msztolcman/node-list-cycler/issues
- npm.io page: https://npm.io/package/list-cycler

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-05-03
- 0.0.3 — 2016-04-27
- 0.0.2 — 2013-08-26

## README

node-list-cycler
================

Infinity cycle through list

Install:
--------

```npm install list-cycler```

Current stable version
----------------------

1.0.0

Examples:
---------

Iterate from beginning of list:
```javascript
var cycler = require("list-cycler"),
    colors = cycler(['red', 'green', 'blue']),
    i=6;
while (--i) {
    console.log(i + '. <span color="' + colors.current() + '">' + colors.current() + '</span>');
    colors.cycle();
}
```

Or using other API:
```javascript
var cycler = require("list-cycler"),
    colors = cycler(['red', 'green', 'blue']),
    color,
    i=6;
while (--i) {
    color = colors.next();
    console.log(i + '. <span color="' + color + '">' + color + '</span>');
}
```

If should start from index other then 0 - here iterate
from index 1 (letter 's') - look at second argument to *cycler*:
```javascript
var cycler = require('list-cycler'),
    colors = cycler(['red', 'green', 'blue'], 1),
    i=6

while (--i) {
    console.log(i + '. <span color="' + colors.current() + '">' + colors.current() + '</span>');
    colors.cycle();
}
```

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