[](https://github.com/climba03003/fastify-bree/actions/workflows/ci.yml) [




This plugin integrate bree with fastify to support scheduling jobs.
> Disclaimer: Although this plugin add a handy method to integrate with TypeScript. It is a known issue TypeScript do not have a good support about worker_threads.
npm install fastify-bree --saveyarn add fastify-bree
`Usage
`ts
import Fastifybree from 'fastify-bree'
import * as path from 'path'fastify.register(Fastifybree, {
customOptions: {
root: path.resolve('jobs')
}
})
await fastify.bree.add({
name: 'cron' // which will use the file -
process.cwd()/jobs/cron.ts
})`$3
#### options.customOptions
The options which will be directly passed to
bree.`ts
import Fastifybree from 'fastify-bree'fastify.register(Fastifybree, {
customOptions: {
}
})
`bree#### options.autoStart
This options will add a
onReady hooks to start all pre-registered jobs.`ts
import Fastifybree from 'fastify-bree'fastify.register(Fastifybree, {
autoStart: true
})
`#### options.autoClose
This options will add a
onClose hooks to stop all running jobs.`ts
import Fastifybree from 'fastify-bree'fastify.register(Fastifybree, {
autoClose: true
})
``