How to find a domain's registration date with Node.js - ZeroProjects.ca

node v8.17.0
version: 1.0.0
endpointsharetweet
You can find out the Updated Date, Creation (Registration) Date, Expiration Date and other interesting pieces of registry information about a website via the WHOIS protocol. Here's an example Node.js snippet showing you how. Cloneable code: https://github.com/ZeroProjectsInc/snippets/tree/master/whois - Courtesy of Zero Projects, a software development firm in Toronto, Canada. You can see more about us at https://zeroprojects.ca
const whois = require('whois-api'); const DOMAIN_NAME = 'google.com'; whois.lookup(DOMAIN_NAME, function(error, result) { if (error) { // Error condition console.error('Something went wrong', error); return; } console.log(`Queried ${DOMAIN_NAME}. Results:`); console.log(`Creation Date: ${result.creation_date}`); console.log(`Updated Date: ${result.updated_date}`); console.log(`Expiration Date: ${result.expiration_date}`); /* It should say: Queried google.com. Results: Creation Date: 1997-09-15T04:00:00Z Updated Date: 2018-02-21T18:36:40Z Expiration Date: 2020-09-14T04:00:00Z */ });
Loading…

no comments

    sign in to comment