
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@neofinancial/chrono
Advanced tools
⚠️ This project is pre-alpha, and not ready for production use. ⚠️
A TypeScript task scheduling and processing system for reliable background job processing.
npm install @neofinancial/chrono
# or
pnpm add @neofinancial/chrono
# or
yarn add @neofinancial/chrono
import { Chrono } from "@neofinancial/chrono";
// Define your task types
type TaskMapping = {
"send-email": { to: string; subject: string; body: string };
"process-payment": { userId: string; amount: number };
};
// You'll need a datastore implementation
// See @neofinancial/chrono-memory-datastore or @neofinancial/chrono-mongo-datastore
const datastore = /* your datastore instance */;
// Initialize Chrono with the datastore
const chrono = new Chrono<TaskMapping, undefined>(datastore);
// Register task handlers
chrono.registerTaskHandler({
kind: "send-email",
handler: async (task) => {
// Logic to send an email
console.log(
`Sending email to ${task.data.to} with subject "${task.data.subject}"`
);
},
backoffStrategyOptions: {
type: "linear",
baseDelayMs: 1000,
incrementMs: 2000,
},
});
chrono.registerTaskHandler({
kind: "process-payment",
handler: async (task) => {
// Logic to process payment
console.log(
`Processing payment of ${task.data.amount} for user ${task.data.userId}`
);
},
backoffStrategyOptions: {
type: "exponential",
baseDelayMs: 1000,
maxDelayMs: 60000,
jitter: "full",
},
});
// Start Chrono
await chrono.start();
// Schedule tasks
await chrono.scheduleTask({
kind: "send-email",
when: new Date(), // run immediately
data: {
to: "user@example.com",
subject: "Welcome!",
body: "Welcome to our application!",
},
});
// Schedule a task for the future
const thirtyMinutesFromNow = new Date(Date.now() + 30 * 60 * 1000);
await chrono.scheduleTask({
kind: "process-payment",
when: thirtyMinutesFromNow, // run 30 minutes from now
data: {
userId: "user-123",
amount: 99.99,
},
idempotencyKey: "payment-123", // Prevents duplicate processing
});
// For cleanup when shutting down
process.on("SIGINT", async () => {
await chrono.stop();
process.exit(0);
});
Chrono requires a datastore implementation to persist and manage tasks. Available implementations:
ready
- Emitted when all processors are started as a result of calling chrono.start()
close
- Emitted after stopping all processors as a result of calling chrono.stop()
stop:failed
- Emitted if any processor fails to stop within the exit timeoutTask related events
task:claimed
- Emitted when a task is claimedtask:completed
- Emitted when a task is successfully processedtask:completion:failed
- Emitted when the task fails to mark as completedtask:retry:requested
- Emitted when a task will be retried after an errortask:failed
- Emitted when max retries is reached after errorsChrono supports configurable retry strategies:
{
type: "none";
}
{
type: "fixed",
delayMs: 1000 // Fixed delay in milliseconds
}
{
type: "linear",
baseDelayMs: 1000, // Initial delay
incrementMs: 2000, // Amount to add each retry
}
{
type: "exponential",
baseDelayMs: 1000, // Initial delay
maxDelayMs: 60000, // Maximum delay cap
jitter: "full", // Optional: "none" | "full" | "equal"
}
This package is written in TypeScript and provides full type safety for your task definitions and handlers.
MIT
This package is part of the chrono monorepo. Please see the main repository for contributing guidelines.
FAQs
Core package for Chrono task scheduling system
The npm package @neofinancial/chrono receives a total of 15 weekly downloads. As such, @neofinancial/chrono popularity was classified as not popular.
We found that @neofinancial/chrono demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 139 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.