Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Bindings for node-cron, a tool that allows you to execute something on a schedule. This is typically done using the cron syntax:
* * * * * *
┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ │
│ │ │ │ │ └ day of week (0 - 6, or sun - sat), 0 is Sunday
│ │ │ │ └───── month (0 - 11, or jan - dec)
│ │ │ └────────── day of month (1 - 31)
│ │ └─────────────── hour (0 - 23)
│ └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)
Learn more about the syntax at crontab.guru (NB it does not have the seconds parameter and months start at 1 (this lib has 0-indexed months)).
yarn add bs-cron
Then add bs-cron
as a dependency to bsconfig.json
:
"bs-dependencies": [
+ "bs-cron"
]
open BsCron
// Make a job that will fire every second when started
let job =
CronJob.make(
`CronString("* * * * * *"),
_ => Js.log("Just doing my job"),
(),
);
// Firing every second, printing 'Just doing my job'
start(job);
let time =
CronTime.make(`JsDate(Js.Date.fromString("2021-04-11T10:20:30Z")), ());
// setTime will stop the current job, and change when it will fire next
setTime(job, time);
// It will now fire once in april 2021
start(job);
The tests have more examples of how to use these bindings.
yarn.lock
is updated.node-schedule is a JS library similar to node-cron (which this library is bindings for).
FAQs
Cron for NodeJS. Execute something at a schedule.
The npm package bs-cron receives a total of 0 weekly downloads. As such, bs-cron popularity was classified as not popular.
We found that bs-cron 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.