New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

easy-loop

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-loop

Easy sync loop processing for Node.js

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
109
increased by14.74%
Maintainers
1
Weekly downloads
 
Created
Source

easy-loop

쉬운 동기식 반복 처리 (easy sync loop processing)

Arguments

1) Array or Object 		- require
2) process function 	- require
3) callback function 	- option

Examples

## Case 1 ##

var loop = require('easy-loop');

var arr = [1,2,3,4,5];

// available function name => 'for' or 'while' or 'loop'
loop.for(arr, function(i, value, next){	
	console.log(i, "=>", value);
	next();		//require
}, function(err){
	console.log("end");
});


## Result ##
0 '=>' 1
1 '=>' 2
2 '=>' 3
3 '=>' 4
4 '=>' 5
end




## Case 2  ##

var arr = [1,2,3,4,5];

// available function name => 'for' or 'while' or 'loop'
loop.while(arr, function(i, value, next){	
	console.log(i, "=>", value);
	if(i === 2)	next("error");
	else 		next();
}, function(err){
	console.log("end");
});


## Result ##
0 '=>' 1
1 '=>' 2
2 '=>' 3
end




## Case 3 ##

var obj = {a:1, b:2, c:3, d:4, e:5};

// available function name => 'for' or 'while' or 'loop'
loop.loop(arr, function(key, value, next){	
	console.log(key, "=>", value);
	next();
}, function(err){
	console.log("end");
});


## Result ##
a => 1
b => 2
c => 3
d => 4
e => 5
end

Keywords

FAQs

Package last updated on 12 Jan 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc