2.0.9 • Published 2 years ago
heart-ping v2.0.9
Heart Ping
A simple light-weight Typescript module for pinging HTTP services at set intervals to provide a heartbeat.
Installation
yarn add heart-ping
Usage
import HeartPing from 'heart-ping';
const heartPing = new HeartPing();
heartPing.setBeatInterval(10_000);
heartPing.setBeatTimeout(30_000);
heartPing.setOnTimeout(() => {
console.log('The ping request to www.google.com has timed out!');
});
heartPing.start(
'www.google.com', // or using https, e.g.: 'https://www.google.com'
80,
(time) => {
console.log(`Successfully pinged www.google.com! It took ${time} milliseconds.`);
},
() => {
console.log('Failed to ping www.google.com!');
},
);
License
MIT License
Contributing
Contributions are encouraged, please see further details below:
Pull Requests
Here are some basic rules to follow to ensure timely addition of your request:
- Match coding style (braces, spacing, etc.).
- If it is a feature, bugfix, or anything please only change the minimum amount of code required to satisfy the change.
- Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge.
- Pull requests must be made against the
main
branch. Any other branch (unless specified by the maintainers) will get rejected. - Check for existing issues first, before filing a new issue.
2.0.9
2 years ago
2.0.7
2 years ago
2.0.8
2 years ago
2.0.4
2 years ago
2.0.6
2 years ago
2.0.1
2 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.11
4 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago