New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

controlled-loop

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

controlled-loop

A javascript module for moving forward, backward, and in a non-linear fashion through an array or object one or more keys at a time.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

controlledLoop

A javascript module for moving forward, backward, and in a non-linear fashion through an array or object one or more keys at a time.

Summary

Creating a controlled-loop allows you to move through an array or object in many different ways

  • iterate similar to generators with next()
  • backup with previous()
  • run in bulk like a forEach() but with the ability to stop at any time
  • chunk or batch a group of items at a time
  • iterate over every nth item
  • iterate in reverse
  • reverse direction mid-flow
  • skip over items
  • goto a specific key
  • Set your own keys array to only use a subset of properties or to set the order
  • change the callback at any time
### Homepage

http://www.ozonecreations.com/projects/controlled-loop

Installing

GitHub

https://github.com/bartmelton/ControlledLoop

NPM

npm install controlled-loop

Bower

bower install controlled-loop

Exports:

  • It will export as an AMD module if available, otherwise it will try to export as a CommonJS module
  • If Lodash or Underscore are available, it adds as a mixin.
  • If none of the above options are available it falls back to a global controlledLoop() function attached to window, global, or this depending on which is available.

Node

var controlledLoop = require("controlled-loop").controlledLoop

Lodash/Underscore

_.controlledLoop()

Default

controlledLoop();

Keywords

javascript

FAQs

Package last updated on 03 Mar 2017

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