
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
mongo-heartbeat
Advanced tools
Ping mongodb every x seconds to prevent disconnections.
npm i mongo-heartbeat
var MongoHeartbeat = require('mongo-heartbeat');
var hb = MongoHeartbeat(db, {
interval: 5000, //defaults to 5000 ms,
timeout: 10000 //defaults to 10000 ms
tolerance: 2 //defaults to 1 attempt
});
hb.on('error', function (err) {
console.error('mongodb didnt respond the heartbeat message');
process.nextTick(function () {
process.exit(1);
});
});
This module uses the debug module, use as follows:
DEBUG=mongo-heartbeat node server
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.
FAQs
Ping mongodb every x seconds to prevent disconnections
We found that mongo-heartbeat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.