node-list-cycler
Infinity cycle through list
Install:
npm install list-cycler
Current stable version
1.0.0
Examples:
Iterate from beginning of list:
var cycler = colors = i=6;while --i console; colors;
Or using other API:
var cycler = colors = color i=6;while --i color = colorsnext; console;
If should start from index other then 0 - here iterate from index 1 (letter 's') - look at second argument to cycler:
var cycler = colors = i=6 while --i console; colors;