npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

domrobot-client

v3.2.2

Published

INWX Domrobot Node.JS Client

Downloads

5,038

Readme

INWX Domrobot Node.js Client

You can access all functions of our frontend via our API, which is available via the JSON-RPC protocol and thus can be easily consumed with all programming languages.

There is also an OT&E test system, which you can access via ote.inwx.com. Here you will find the known web interface which is using a test database. On the OT&E system no actions will be charged. So you can test as much as you like there.

Documentation

You can view a detailed description of the API functions in our documentation. You can find the online documentation by clicking here.

If you still experience any kind of problems don't hesitate to contact our support via email.

Installation

The recommended way is via npm:

npm install --save domrobot-client

You can find more information about the package on npmjs.org.

Example

import { ApiClient, Language } from 'domrobot-client';

const username = '';
const password = '';
const sharedSecret = ''; // only needed for 2FA.
const domain = 'my-test-domain-' + Math.round(Math.random() * 1e8) + '.com'; // the domain which will be checked.

const asyncFunc = async () => {
    // By default your ApiClient uses the test api (OT&E). If you want to use the production/live api
    // we have a constant named API_URL_LIVE in the ApiClient class. Just set apiUrl=ApiClient.API_URL_LIVE and you're good.
    const apiClient = new ApiClient(ApiClient.API_URL_OTE, Language.EN, true);

    const loginResponse = await apiClient.login(username, password, sharedSecret);
    if (loginResponse.code !== 1000) {
        throw new Error(`Api login error. Code: ${loginResponse.code}  Message: ${loginResponse.msg}`);
    }

    // Make an api call and save the result in a variable.
    // We want to check if a domain is available, so we call the api method 'domain.check'.
    const domainCheckResponse = await apiClient.callApi('domain.check', { domain });
    if (domainCheckResponse.code !== 1000) {
        throw new Error(`Api error while checking domain status. Code: 
                            ${domainCheckResponse.code}  Message: ${domainCheckResponse.msg}`);
    }

    // get the first domain in the result array 'domain'
    const checkedDomain = domainCheckResponse.resData.domain[0];
    if (checkedDomain.avail === 1) {
        console.log(`${domain} is still available!`);
    } else if (checkedDomain.avail === -1) {
        console.log(`Availability of ${domain} could not be checked.`);
    } else {
        console.log(`Unfortunately, ${domain} is already registered.`);
    }
};

// call the async function
asyncFunc();

License

MIT