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

callevery

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callevery

setInterval on steroids

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

#callEvery setInterval on steroids for node.

##Usage

npm i -S callevery

The package exports a default function which takes a string argument in the format "hh:mm:ss". It returns another function which takes varying number arguments: the function to be called after the set duration and all the arguments to be passed to this function if any.

import callEvery from 'callevery';

const callEveryFiveSeconds = callEvery("00:00:05");

const logX = (x, y) => {
 console.log(x+y);
}

const timer1 = callEveryFiveSeconds(logX, "WestCoast", "BestCoast"); // Logs WestCoastBestCoast every 5 seconds

const timer2 = callEvery("00:00:01")(logX, "a", "b"); // Alternatively

clearInterval(timer1);
clearInterval(timer2);

Keywords

FAQs

Package last updated on 01 Jun 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