New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

uber-cron

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uber-cron

Enhanced cron job scheduling with features you didn't know you need!

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

UBER CRON

Enhanced cron job scheduling with features you didn't know you need! Based on cron: https://www.npmjs.com/package/cron

What has been added

The following functionality was implemented on top of the cron package:

  • Control the number of executions that run in parallel using the numParallelExecutions paramter.
  • Configure whether a job should be stopped if an execution error occurs.
  • Uses a provided logger object to log the following events:
    • JOB_STARTED: A job has been started
    • JOB_STOPPED: A job has been stoppped
    • JOB_EXECUTION_STARTING: The onTick method of a job is about to be executed
    • JOB_EXECUTION_FINISHED: The onTick method of a job finished successfully
    • JOB_EXECUTION_ERROR: An error occured during the execution of the job's onTick method
    • REACHED_MAX_PARALLEL_EXECUTIONS: The maximum number of parallel job executions has been reached (the request to start another job execution has been ignored)

Installation

Installation is straight forward with npm:

npm i uber-cron

Examples

const cronJob = new UberCron('simpleJob', {
  cronTime: '*/1 * * * * *',
  start: true,
  logger: null,
  onTick: () => console.log(`Job being executed right now!`),
});

setTimeout(() => cronJob.stop(), 3500);

/**
OUTPUT:

root@uber-cron:/app# npm run start
> uber-cron@1.0.0 start /app
> ts-node --project tsconfig.json example/index.ts

Job being executed right now!
Job being executed right now!
Job being executed right now!
 */

API Documentation

The full API documentation can be found here: https://decentro-gmbh.github.io/uber-cron/

FAQs

Package last updated on 19 Feb 2019

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