resource-cron

for managing cron jobs

npm install resource-cron
9 downloads in the last month

cron

for managing cron jobs

API

properties

methods

properties

for managing cron jobs

  • id

    • type : any
  • pattern

    • type : string

    • default : /5

    • description : the pattern of the cron job

  • event

    • type : string

    • default : logger::log

    • description : the event to be emitted each time the cron runs

  • with

    • type : object

    • description : metadata to execute the cron with

methods

cron.create(options, callback)

create a new cron

  • options

    • type : object

    • properties

      • id

        • type : any
      • pattern

        • type : string

        • default : /5

        • description : the pattern of the cron job

      • event

        • type : string

        • default : logger::log

        • description : the event to be emitted each time the cron runs

      • with

        • type : object

        • description : metadata to execute the cron with

  • callback

    • type : function

cron.get(id, callback)

get cron by id

  • id

    • type : any

    • description : the id of the object

    • required : true

  • callback

    • type : function

cron.find(options, callback)

search for instances of cron

  • options

    • type : object

    • properties

      • id

        • type : any

        • default :

        • required : false

      • pattern

        • type : any

        • default :

        • description : the pattern of the cron job

        • required : false

      • event

        • type : any

        • default :

        • description : the event to be emitted each time the cron runs

        • required : false

      • with

        • type : any

        • description : metadata to execute the cron with

        • default :

        • required : false

  • callback

    • type : function

cron.all(callback)

gets all instances of cron

  • callback

    • type : function

cron.update(options, callback)

updates a cron by id

  • options

    • type : object

    • properties

      • id

        • type : any
      • pattern

        • type : string

        • default : /5

        • description : the pattern of the cron job

      • event

        • type : string

        • default : logger::log

        • description : the event to be emitted each time the cron runs

      • with

        • type : object

        • description : metadata to execute the cron with

  • callback

    • type : function

cron.updateOrCreate(options, callback)

updates a cron by id, and creates if necessary

  • options

    • type : object

    • properties

      • id

        • type : any
      • pattern

        • type : string

        • default : /5

        • description : the pattern of the cron job

      • event

        • type : string

        • default : logger::log

        • description : the event to be emitted each time the cron runs

      • with

        • type : object

        • description : metadata to execute the cron with

  • callback

    • type : function

cron.destroy(id, callback)

destroys a cron by id

  • id

    • type : string

    • description : the id of the object

    • required : true

  • callback

    • type : function

cron.run()

runs / starts a cron job

cron.start()

starts the cron resource ( which will run all cron jobs )

dependencies

README auto-generated with docs

npm loves you