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

whois-to-json

v1.0.4

Published

A npm package that outputs json from whois command

Downloads

15

Readme

whois-to-json

A npm package that outputs json from whois command.



Install

npm install whois-to-json

Dependencies

None with one mention:

If you are using Windows you need to download Whois from Microsoft Website, unzip and put :

  • whois.exe -> [WindowsDriveLetter]\Windows\System32 ( for 32-bit systems )
  • whois64.exe -> [WindowsDriveLetter]\Windows\SysWOW64 ( for 64-bit x86 systems )

Usage

const whois = require('whois-to-json');

whois('saveni.ro')
  .then(data => {
    console.log(JSON.stringify(data, null, 2));
  })
  .catch(console.error);

Output

For duplicate keys, a array is created which will contain all values (duplicate values are ignored)

{  
  refer:'whois.rotld.ro',
  domain:'RO',
  organisation:'National Institute for R&D in Informatics',
  address:[  
    'Bd. Averescu 8-10',
    'Bucharest 011454',
    'Romania',
    'Sector 1',
    '8-10, Bd. Averescu'
  ],
  contact:[  
    'administrative',
    'technical'
  ],
  name:[  
    'Ionut Eugen SANDU',
    '.ro TLD Tech Contact'
  ],
  phone:'+40 21 4057200',
  'fax-no':[  
    '+40 21 316 5340',
    '+40 21 316 1084'
  ],
  'e-mail':[  
    '[email protected]',
    '[email protected]'
  ],
  nserver:[  
    'DNS-AT.ROTLD.RO 2001:628:453:bb:0:0:0:6 78.104.145.6',
    'DNS-RO.DENIC.DE 81.91.161.99',
    'PRIMARY.ROTLD.RO 192.162.16.18 2a03:5e80:0:4:192:162:16:18',
    'SEC-DNS-A.ROTLD.RO 192.162.16.20 2a03:5e80:0:4:192:162:16:20',
    'SEC-DNS-B.ROTLD.RO 193.230.31.230 2a03:5e80:0:5:193:230:31:230',
    'SNS-PB.ISC.ORG 192.5.4.1 2001:500:2e:0:0:0:0:1'
  ],
  'ds-rdata':'19267 8 2 499357E3CC1449108F1E2BB70A1B952D140871A50E41138786EB51A2316468EA',
  whois:'whois.rotld.ro',
  status:'ACTIVE',
  remarks:'Registration information: http://www.rotld.ro/',
  created:'1993-02-26',
  changed:'2018-05-11',
  source:'IANA',
  DomainName:'saveni.ro',
  RegisteredOn:'2008-08-07',
  ExpiresOn:'2018-09-07',
  Registrar:'ICI - Registrar',
  ReferralURL:'http://www.rotld.ro',
  DNSSEC:'Inactive',
  Nameserver:[  
    'ns1.digitalocean.com',
    'ns3.digitalocean.com',
    'ns2.digitalocean.com'
  ],
  DomainStatus:'PendingDelete'
}

Errors

Program shows a warning but exit successfully ( eg. you provide a empty string )

{
  domain: '',
  reason 'whois: no default whois server'
}

Program exit with a code different than 0 ( code is added in case you want to treat the error )

{
  code: -1,
  domain: 'saveni.ro',
  reason: 'cannot connect()'
}

Issues

Please report if you find any issues.


Contribute

If you want to contribute, feel free to do so.

Open a PR and tag me.

Thank you in advance for your contribution!


License

MIT