2.0.0 • Published 8 years ago

circ-iter v2.0.0

Weekly downloads
4
License
WTFPL
Repository
github
Last release
8 years ago

circ-iter

npm.io npm.io

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 :heart: by @MarkTiedemann.