1.0.0 • Published 8 years ago

n-times v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

n-times

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