@mongodb-helpers/health-check
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@mongodb-helpers/health-check


Build Status Coverage Status NPM version Code Size License

Simple helper function for checking if your mongoose/mongodb connection to MongoDB is good 🪁.

Installation

# npm
$ npm install @mongodb-helpers/health-check mongodb
# yarn
$ yarn add @mongodb-helpers/health-check mongodb

When use mongoose should you also add mongoose

Usage

This is a practical example of how to use.

import { healthCheck } from "@mongodb-helpers/health-check";

const status = await healthCheck(MonogoDBorMongooseClient);
// 'Connected' | 'Disconnected'
// MonogoDBorMongooseClient:
// - mongodb: const client = await MongoClient.connect(MONGODB_URL)
// - mongoose: const client = await mongoose.connect(MONGODB_URL)

License


MIT © Imed Jaberi

Package Sidebar

Install

npm i @mongodb-helpers/health-check

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

6.08 kB

Total Files

6

Last publish

Collaborators

  • 3imed-jaberi