3.1.0 • Published 7 years ago

@financial-times/n-worker v3.1.0

Weekly downloads
14
License
MIT
Repository
github
Last release
7 years ago

n-worker

Setup of basic next enhancements for non-web dynos e.g. cron-jobs, pollers

API

n-worker#setup(options)

Sets up node enhamcemets

  • fetch as a global using isomorphic-fetch
  • metrics for processes and fetch
  • flags (optional)

    options:

  • withFlags default false - waits for the flags client to initialise and start polling

  • name optional - will get the app name from package.json if absent
  • directory defaults to process.cwd() directory in which to look for config code

Returns a Promise.

Usage: javascript worker.setup(options).then(function(){ //Application init code })

n-worker#CronJob(options)

Constructor for a new cron job, with metrics etc. added. options expects the same as npm cron.CronJob

n-worker#metrics

Reference to the instance of metrics used by the job

n-worker#flags

Reference to the instance of flags used by the job

3.1.0

7 years ago

3.0.2

7 years ago

3.0.1

8 years ago

2.0.7

8 years ago

2.0.5

9 years ago

2.0.4

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.1-beta.1

10 years ago