Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

Domai.nr

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Domai.nr

A dead-simple way to utilize Domai.nr's JSON API

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

The Domai.nr NPM package is a dead-simple way to utilize Domai.nr's JSON API. It only comes with two methods: search and info, but that's all we need to get a ton of work done with the data behind Domai.nr.

Installation

$ npm install Domai.nr

Documentation

Like previously mentioned, this package comes with two methods available: search, and info. Both of them take two arguments: a query and a callback (which aliases the parameter you pass into it as the data that's returned from Domai.nr, so you can do whatever you want with it).

.search(query, callback)

The .search method abstracts Domainr's own search endpoint. The response will be a JSON object, like so:

{
    "query": "domai.nr",
    "results": [{
      "domain": "domai.nr",
      "register_url": "http://domai.nr/domai.nr/register",
      "host": "",
      "path": "",
      "subdomain": "domai.nr",
      "availability": "taken"
    },
    {
      "domain": "dom.ai",
      "register_url": "http://domai.nr/dom.ai/register",
      "host": "",
      "path": "/nr",
      "subdomain": "dom.ai",
      "availability": "available"
    },
    {
      "domain": "doma.in",
      "register_url": "http://domai.nr/doma.in/register",
      "host": "",
      "path": "/r",
      "subdomain": "doma.in",
      "availability": "taken"
    },
    {
      "domain": "do.ma",
      "register_url": "http://domai.nr/do.ma/register",
      "host": "",
      "path": "/i.nr",
      "subdomain": "do.ma",
      "availability": "maybe"
    },
    {
      "domain": "d.om",
      "register_url": "http://domai.nr/d.om/register",
      "host": "",
      "path": "/ai.nr",
      "subdomain": "d.om",
      "availability": "unavailable"
    },
    {
      "domain": "do",
      "register_url": "http://domai.nr/do/register",
      "host": "",
      "path": "/mai.nr",
      "subdomain": "do",
      "availability": "tld"
    }]
}

To use .search(), it's very simple:

var domainr = require('domainr')

domainr.search("google.com", function(responseFromDomainr) {
	// the responseFromDomainr is the JSON object mentioned above
})
.info(query, callback)

The .info method is called in the exact same way. It's an abstraction from Domainr's own Info endpoint.

The difference between .info() and .search() is the JSON response: it is information about the domain you pass in. See an example below:

{
  "domain": "domai.nr",
  "whois_url": "http://domai.nr/domai.nr/whois",
  "register_url": "http://domai.nr/domai.nr/register",
  "tld": {
    "domain": "nr",
    "domain_idna": "nr",
    "wikipedia_url": "http://wikipedia.org/wiki/.nr",
    "iana_url": "http://www.iana.org/domains/root/db/nr.html"
  },
  "registrars": [{
    "registrar": "cenpac.net.nr",
    "name": "CenpacNET",
    "register_url": "http://domai.nr/domai.nr/register/cenpac.net.nr"
  }],
  "host": "",
  "path": "",
  "www_url": "http://domai.nr/domai.nr/www",
  "query": "domai.nr",
  "subdomain": "domai.nr",
  "domain_idna": "domai.nr",
  "availability": "taken"
}

To use .info(), it's very simple:

var domainr = require('domainr')

domainr.info("cnnr.me", function(responseFromDomainr) {
	// the responseFromDomainr is the JSON object mentioned above
})

Examples

I prefer making my express apps driven by an internal API. By that, I mean I like to set up back-end routes that my front-end routes can receive data from.

I have made 2 simple apps using this package: one using express, and a twitter bot. You can see them both in the /example directory within this repo.

Shameless Plug

I really like Domai.nr. If you do too, you may be interested in the chrome extension or twitter bot I wrote.

Keywords

FAQs

Package last updated on 28 May 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc