Socket
Socket
Sign inDemoInstall

ping-tcp-js

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ping-tcp-js

Welcome to 👋


Version published
Weekly downloads
92
decreased by-40.26%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to 👋

install

npm install ping-tcp-js

ping

  • param
const client = require("ping-tcp-js");
// or
import client from "ping-tcp-js";

const host = "google.com";
const port = 80;

await client.ping(
  { host, port },
  { timeout: 5000 } // optional
);
  1. host
const client = require("ping-tcp-js");
// or
import client from "ping-tcp-js";

const host = "google.com";
const port = 80;

client
  .ping({ host, port })
  .then(() => console.log("connect ping"))
  .catch((e) => console.error("not disconnet", e));
  1. url
const client = require("ping-tcp-js");
// or
import client from "ping-tcp-js";

const host = "https://google.com";

client
  .ping({ host })
  .then(() => console.log("connect ping"))
  .catch((e) => console.error("not disconnet", e));

pingBackOff

time : Reconnect time count : Number of times

  • param
const client = require("ping-tcp-js");
// or
import client from "ping-tcp-js";

const host = "google.com";
const port = 80;

// or
client.pingBackOff({ host, port }, { time: 5000, count: 10, timeout: 5000 });
  1. host
const host = "google.com";
const port = 80;

client
  .pingBackOff({ host, port }, { time: 5000, count: 10, timeout: 5000 })
  .then(() => console.log("connect pingBackOff"))
  .catch((e) => console.error("not disconnet", e));
  1. url
const host = "https://google.com";
client
  .pingBackOff({ host: host }, { time: 5000, count: 10, timeout: 5000 })
  .then(() => console.log("connect pingBackOff"))
  .catch((e) => console.error("not disconnet", e));

Test

npm run test

Keywords

FAQs

Package last updated on 18 Feb 2024

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