1.1.0 • Published 7 months ago

domain-availablity-checker v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

Check Domain

This module provides functionality to check the availability of a domain using WHOIS and RDAP servers.

Installation

  1. Ensure you have Node.js installed.
  2. Install the package by running:
npm install domain-availablity-checker

Usage

Require the checkDomain function in your project:

const checkDomain = require('domain-availablity-checker');

Call the checkDomain function with the domain you want to check:

checkDomain('example.com')
.then(result => {
    console.log(result);
});
.catch(e=>console.log(e))

Output

The checkDomain function returns an object with the following structure:

{
    "domain": "example.com",
    "available": true,
    "message": "✅ The domain is available."
}
  • domain: The domain name that was checked.
  • available: A boolean indicating whether the domain is available.
  • message: A message describing the result of the domain check.

Error Handling

If an error occurs during the domain check, the function will return an object with the following structure:

{
    "domain": "example.com",
    "available": false,
    "message": "⚠️ An error occurred while checking the domain."
}
  • error: A boolean indicating an error occurred.
  • message: A message describing the error.

Dependencies

  • whois: A library for performing WHOIS lookups.
  • util: A Node.js utility module.
  • axios: A promise-based HTTP client for making requests.
1.1.0

7 months ago

1.0.0

7 months ago