
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
cron-webhook
Advanced tools
This module lets you set a cron job that notifies your webhook when data queried changes.
npm i --save cron-webhook
const cronWebhook = require('cron-webhook').startCronWebhook
cronWebhook({
querySettings: {
query: url,
webhook: webhookUrl
}
})
This will perform every minute a get on the provided url and when data changes perform a get on webhookUrl.
Additional parameters and configurations can be set.
import {
CronWebHook, //class
TYPE_XML, //facility for setting the CronWebHook to convert XML response to object
TYPE_JSON, //facility for setting the CronWebHook to convert JSON response to object
TYPE_PLAIN_TEXT, //facility for setting the CronWebHook to convert PLAIN_TEXT response to object
startCronWebHook //facility if you don't care using the class
} from 'cron-webhook'
new CronWebHook({
querySettings: {
query: { // this can either be a url or an object made of method, url, parameters and body
method: httpMethod, //'get', 'post'
url: url,
//...
},
webhook: { // this can either be a url or an object made of method, url, parameters and body
method: httpMethod, //'get', 'post'
url: url,
//...
},
},
objectParser: TYPE_XML | TYPE_JSON | TYPE_PLAIN_TEXT | (string) => JSON.parse(string), //optional, defaults to plain text, function that converts queried response to an object,
objectTransformer: (bject) => object, //optional, defaults to identity, use it to filter out only part of the object you want to test for changes
stateFilePath: stringStateFilePath, //optional, defaults to __tempState.json
onStart: true, //optional, defaults to false, to make the webhook be notified on the first time,
state: null, //optional, initial state. if not provided, it is read from stateFilePath
equal: (s1, s2) => false, //optional, defaults to deepEqual, function that is called to check
cronPattern: '* * * * *', //optional, defaults to * * * * *, that is every minute
})
Visit cron github project for cronPattern. Axios is used for http, so check its docs.
FAQs
Cron for querying data and triggering webhooks
We found that cron-webhook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.