Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

health-checkup

1.0.21 • Public • Published

A health ❤️ check facility to check the status 👍👎 of your modules

Build Status Coverage Status Version Downloads

One function to check the health status of all your app modules.

Features

  • Cache 🕙 check results (able to set expiration time) ✅
  • Supports Bluebird 🐦 promises ✅

How to install

npm install health-checkup

How to use

Use it in your app

Set up health checks that should be performed during a checkup later on

const Health = require('health-checkup')
 
class MyService {
  constructor () {
    this._status = 'ok'
 
    Health.addCheck('my-service', () => {
      return Promise.try(() => {
        if (this._status !== 'ok') {
          throw new Error(`My Service status is ${this._status}`)
        }
      })
    })
  }
}

Perform a checkup and retrieve health report

Health.checkup()
  .then((report) => console.log(report)) 

How to contribute

You can contribute either with code (e.g., new features, bug fixes and documentation) or by donating 5 EUR. You can read the contributing guidelines for instructions on how to contribute with code.

All donation proceedings will go to the Sverige för UNHCR, a swedish partner of the UNHCR - The UN Refugee Agency, a global organisation dedicated to saving lives, protecting rights and building a better future for refugees, forcibly displaced communities and stateless people.

Used by

  • serverful - A kickass 💪 web server 🙀 with all the bells 🔔 and whistles ✨

License

Read the license for permissions and limitations.

Keywords

none

install

npm i health-checkup

Downloadsweekly downloads

112

version

1.0.21

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability