JSPM

domain-availablity-checker

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q32592F
  • License ISC

Simple domain availability checker

Package Exports

  • domain-availablity-checker
  • domain-availablity-checker/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (domain-availablity-checker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.