---
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

**Signature:**

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

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

specs


</td><td>

[BindingSpec](./context.bindingspec.md)<!-- -->\[\]


</td><td>

Extra binding specs


</td></tr>
</tbody></table>

**Returns:**

ClassDecorator

## Example


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


