circ-iter

2.0.0 • Public • Published

circ-iter

Simple circular Array and String iterator.

Installation

npm install circ-iter

Usage

/* With an Array */
 
const next = require('circ-iter')([1, 2, 3])
 
next() // => 1
    next() // => 2
        next() // => 3
 
next() // => 1
    next() // => 2
        next() // => 3
 
/* With a String */
 
const next = require('circ-iter')('abc')
 
next() // => 'a'
    next() // => 'b'
        next() // => 'c'
 
next() // => 'a'
    next() // => 'b'
        next() // => 'c'
 

License

WTFPL – Do What the F*ck You Want to Public License.

Made with ❤️ by @MarkTiedemann.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i circ-iter

Weekly Downloads

0

Version

2.0.0

License

WTFPL

Last publish

Collaborators

  • marktiedemann