Skip to content

Domain Availability Service for Swedish .SE domains in a promised base interface available from npm

License

Notifications You must be signed in to change notification settings

kpalmvik/se-free

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

se-free

Wraps the Domain Availability Service for Swedish .SE domains in a promised base interface available from npm. This makes it easy to check if a specified .SE domain is available for registration, already registered, or invalid.

The same interface may also be used to check availability of a .SE contact identifier.

Usage

Installation

Using npm

$ npm install se-free

or, using yarn:

$ yarn add se-free

Check domain availability

The isFree function returns a promise. If the backend service is responding in the expected way, the promise is fulfilled with one of the following values:

  • FREE: The domain is available for registration
  • OCCUPIED: The domain is already registered
  • NOT_VALID: The domain does not comply with the domain naming convention and is not available for registration

If the backend for some reason does not respond in an expected way, the promise is rejected.

const isFree = require('se-free');

const domain = 'example.se';

isFree(domain)
  .then((result) => {
    if(result === 'FREE') {
      console.log(`The domain ${domain} is available`);
    } else {
      console.log(`It is not possible to register the domain ${domain}`);
    }
  })
  .catch((err) => {
    console.log('Something went wrong.', err);
  });

Backend service

The module relies on the service provided by free.iis.se.

The backend service has the following restrictions:

  • A maximum of 34 requests per second and client.
  • A client will be temporarily blocked after making more than 34 requests per second. The client must be idle for one second to restore access to the service.

See Rules and description of "free" from Internetstiftelsen for more details.

License

The MIT License (MIT)

Copyright (c) 2015-2020 Kristofer Palmvik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Domain Availability Service for Swedish .SE domains in a promised base interface available from npm

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published