New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

domain-available

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain-available

Check if domain is available using freedomainapi.com

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

node-domain-available

Check if a domain name is available using freedomainapi.com. Requires an API key, you can get one here.

Installation

Install via NPM:

npm install domain-available

Domain-available uses request, so isn't available in the browser.

Example

var DomainAvailable = require("domain-available");
var domainChecker = new DomainAvailable("{freedomainapi.com API key}");

// Use a domain string or array of domains.
domainChecker.check(["google.com", "rpf.me", "heyheyletsgokinkachu.org"], function(err, url, available, body){

    // The first function is called after each domain is checked.
    if(available){
        console.log(url + " is available.");
    } else {
        console.log(url + " is not available.");
    }

}, function(results){

    // The second function is called after all domains have been checked.
    // Results is an array of responses from freedomainapi.
    var numAvailable = results.reduce(function(num, result){
        return result.available ? num + 1 : num;
    }, 0);

    console.log(numAvailable + " domain(s) available.");

});

Keywords

domain

FAQs

Package last updated on 27 Jan 2015

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