Socket
Book a DemoInstallSign in
Socket

n-times

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n-times

Run a function N times

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

Keywords

callback

FAQs

Package last updated on 26 Feb 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