Skip to content

rafaelrinaldi/n-times

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n-times Build Status

Run a function 𝘕 times

Install

$ npm install n-times --save

Usage

const times = require('n-times');
const beep = bop => console.log(bop);

times(3, beep, 'yadda');
// => yadda
// => yadda
// => yadda

API

times(n, fn, ...args)

n

Required
Type: integer

Number of times to run a function.

fn

Required
Type: function

Function to run N times.
Receives the value of current iteration as the last argument.

...args

Type: arguments

List of arguments to pass to fn on every call.

License

MIT © Rafael Rinaldi

About

Run a function N times

Resources

License

Stars

Watchers

Forks

Packages

No packages published