# @abtnode/cron

> Simple lib to manage crons in ABT Node

Latest version **1.17.12** (published 2026-04-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @abtnode/cron
pnpm add @abtnode/cron
yarn add @abtnode/cron
bun add @abtnode/cron
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.17.12 |
| Published | 2026-04-22 |
| First published | 2020-11-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a |

## Links

- npm: https://www.npmjs.com/package/@abtnode/cron
- npm.io page: https://npm.io/package/@abtnode/cron

## Dependencies (2)

- [cron](https://npm.io/package/cron.md) ^3.1.7
- [debug](https://npm.io/package/debug.md) ^4.4.1

## Recent versions

- 1.17.12 (latest) — 2026-04-22
- 1.17.13-beta-20261020-042751-541e5c03 (beta) — 2026-10-20
- 1.16.29-next-680cf137 (next) — 2024-07-19
- 1.2.0-prerelease.1 (prelease) — 2021-02-08
- 1.17.13-beta-20261019-135643-7047c876 — 2026-10-19
- 1.17.13-beta-20261019-111429-5cdb5af8 — 2026-10-19
- 1.17.13-beta-20261019-082907-fe71de61 — 2026-10-19
- 1.17.13-beta-20261019-070231-87338763 — 2026-10-19
- 1.17.13-beta-20261019-060220-4c251fcf — 2026-10-19
- 1.17.13-beta-20261019-013222-23d4b329 — 2026-10-19
- 1.17.13-beta-20261018-133339-4428feb0 — 2026-10-18
- 1.17.13-beta-20261018-131740-92d9b271 — 2026-10-18
- 1.17.13-beta-20261018-112055-27bdf21c — 2026-10-18
- 1.17.13-beta-20261018-074057-557246bf — 2026-10-18
- 1.17.13-beta-20261018-055715-2b3472bb — 2026-10-18
- … 1123 more at https://npm.io/package/@abtnode/cron/versions

## README

# Cron Scheduler

A simple wrapper around `cron` to manage jobs in ABT Node

## Usage

```shell
yarn add @abtnode/core
```

Then:

```javascript
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}`);
  },
});
```

---
_Source: https://npm.io/package/@abtnode/cron · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
