🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

cycle-values

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cycle-values

Cycle through an array values

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Npm javascript package

cycle-values

Cycle through values.

// npm install cycle-values
var cycle = require('cycle-values')

// cycle(Array values = [])
var nums = cycle([1, 2, 3])

// Returns a function that when called will give you a new value
console.log(nums())
// > 1
console.log(nums())
// > 2

// You can pass an offset to the fn to skip or go back
console.log(nums(0))
// > 2
console.log(nums(2))
// > 1
console.log(nums(-1))
// > 3

Dev

npm test for testing the code after doing an npm install

Keywords

cycle

FAQs

Package last updated on 18 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts