Socket
Socket
Sign inDemoInstall

@abtnode/cron

Package Overview
Dependencies
5
Maintainers
3
Versions
580
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @abtnode/cron

Simple lib to manage crons in ABT Node


Version published
Maintainers
3
Created

Readme

Source

Cron Scheduler

A simple wrapper around cron to manage jobs in ABT Node

Usage

yarn add @abtnode/core

Then:

const Cron = require('@abtnode/cron');

const fetchIp = () => console.log('fetching ip...');

// Initialize cron scheduler
Cron.init({
  context: {},
  jobs: [
    {
      name: 'refetch-ip',
      time: '0 */30 * * * *', // refetch every 30 minutes
      fn: fetchIp,
    },
  ],
  onError: (error, name) => {
    console.log(`Run job ${name} failed with error: ${error.message}`);
  },
});

FAQs

Last updated on 27 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc