@webb/ping
TypeScript icon, indicating that this package has built-in type declarations

2020.10.1 • Public • Published

@webb/ping

Determine if a URL exists

Install

npm i @webb/ping

Usage

import ping from "@webb/ping";

async() => {
  const theLink = await ping("https://example.com");

  if (theLink.exists)
    // do something with it
  else
    // ignore dead links
};

API

ping(input)

input is the URL you want to check, must include protocol prefix (http:///https://).

input

  • Type: String

Tests

# Run all tests, sequentially
$ npm test

# Test dependencies for latest versions
$ npm run test:dependencies

# Lint "src" directory
$ npm run test:typescript

# Test this module
$ npm run test:assert

# Test coverage for the `test:assert` script
$ npm run test:coverage

# Run the included example
$ npm run example

Note

If this module incorrectly reports a live site as not found, that site might be slow to load and/or is configured strangely.

Readme

Keywords

none

Package Sidebar

Install

npm i @webb/ping

Weekly Downloads

1

Version

2020.10.1

License

MIT

Unpacked Size

8.38 kB

Total Files

8

Last publish

Collaborators

  • netoperatorwibby