Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heart-ping

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heart-ping

A simple light-weight Typescript module for pinging HTTP services at set intervals to provide a heartbeat.

  • 2.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Heart Ping

License Current Version npm

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:

  1. Match coding style (braces, spacing, etc.).
  2. If it is a feature, bugfix, or anything please only change the minimum amount of code required to satisfy the change.
  3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge.
  4. Pull requests must be made against the main branch. Any other branch (unless specified by the maintainers) will get rejected.
  5. Check for existing issues first, before filing a new issue.

Keywords

FAQs

Package last updated on 14 May 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc