btrz-health-check
Advanced tools
Comparing version 1.6.1 to 1.7.1
@@ -7,1 +7,2 @@ "use strict"; | ||
exports.SQSHealthChecker = require("./src/sqs-health-checker").SQSHealthChecker; | ||
exports.SequelizeDbHealthChecker = require("./src/sequelize-health-checker").SequelizeDbHealthChecker; |
{ | ||
"name": "btrz-health-check", | ||
"version": "1.6.1", | ||
"version": "1.7.1", | ||
"description": "A series of classes that will ping different service types to verify accessibility.", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "NODE_ENV=test BUILD_NUMBER=123456789 node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- --ui bdd -t 5000", | ||
"test": "NODE_ENV=test BUILD_NUMBER=123456789 node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- --ui bdd -t 5000 --exit", | ||
"test-w": "NODE_ENV=test BUILD_NUMBER=123456789 node_modules/mocha/bin/mocha -w", | ||
@@ -13,0 +13,0 @@ "publish": "publish" |
@@ -108,1 +108,25 @@ # btrz-health-check [![Circle CI](https://circleci.com/gh/Betterez/btrz-health-check.svg?style=svg)](https://circleci.com/gh/Betterez/btrz-health-check) [![NPM version](https://badge-me.herokuapp.com/api/npm/btrz-health-check.png)](http://badges.enytc.com/for/npm/btrz-health-check) | ||
The config can also contains a `timeout` property and it will be use to fail in case the timeout is reached, the default value is 5000. | ||
### Sequelize | ||
Will check connectivity to the Sequelize DB doing a call to authenticate. | ||
{name: "Sequelize DB", status: 200} //if promise resolves | ||
{name: "Sequelize DB", status: 500} //if promise rejects | ||
#### Usage | ||
const SequelizeDbHealthChecker = require("btrz-health-checker").SequelizeDbHealthChecker, | ||
sequelizeChecker = new SequelizeDbHealthChecker(sequelize); | ||
sequelizeChecker.checkStatus() | ||
.then((result) => { | ||
//working fine | ||
}) | ||
.catch((result) => { | ||
//Something is not right. | ||
}); | ||
The only mandatory parameter is an instance of sequelize. | ||
Internally we will call the `authenticate()` function along with a valid sequelize config, so it should at least implement that function with a valid DB config. | ||
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
28424
21
638
132
3