---
lang: en
title: 'API docs: cron.ascronjob'
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.ascronjob.html
---

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

[Home](./index.md) &gt; [@loopback/cron](./cron.md) &gt; [asCronJob](./cron.ascronjob.md)

## asCronJob() function

A `BindingTemplate` function to configure the binding as a cron job.

**Signature:**

```typescript
export declare function asCronJob<T = unknown>(binding: Binding<T>): Binding<T>;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

binding


</td><td>

[Binding](./context.binding.md)<!-- -->&lt;T&gt;


</td><td>

Binding object


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

**Returns:**

[Binding](./context.binding.md)<!-- -->&lt;T&gt;


