---
lang: en
title: 'API docs: cron.cronjob'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/cron
permalink: /doc/en/lb4/apidocs.cron.cronjob.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/cron](./cron.md) &gt; [cronJob](./cron.cronjob.md)

## cronJob() function

`@cronJob` decorates a cron job provider class

<b>Signature:</b>

```typescript
export declare function cronJob(...specs: BindingSpec[]): ClassDecorator;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  specs | [BindingSpec](./context.bindingspec.md)<!-- -->\[\] | Extra binding specs |

<b>Returns:</b>

ClassDecorator

## Example


```ts
@cronJob()
class CronJobProvider implements Provider<CronJob> {
  constructor(@config() private jobConfig: CronJobConfig = {}) {}
  value() {
    // ...
  }
}
```


