reachy-url
Version:
Zero dependency nodejs library for checking if URL is reachable or not
11 lines (10 loc) • 484 B
TypeScript
import http from "http";
/**
* Check if a URL is reachable
* @param {string} url - URL of the website
* @param {number} [timeout=2000] - Cancel request after (default 2000ms)
* @param {object} [requestOptions] - Optional request parameters for reqest
* @returns {Promise} Promise object with status code or error
*/
declare const isReachable: (url: string, timeout?: number, requestOptions?: http.RequestOptions) => Promise<string | number | Error>;
export default isReachable;