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

rapiddns-io-scrapper

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rapiddns-io-scrapper - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

lib/get-result-entries.js

56

lib/index.js

@@ -1,1 +0,55 @@

module.exports = null;
const { default: axios } = require('axios');
const userAgent = require('./user-agent');
const getResultEntries = require('./get-result-entries');
/**
* @typedef ResultEntry
* @type {object}
* @property {string} domain
* @property {string} address
* @property {string} type
* @property {string} date
*/
/**
* Query to rapiddns.io
*
* @param {string} query - eg: '9.9.9.9', 'slashdot.org'
* @param {('subdomain'|'sameip')} [queryType] - optional, can be 'subdomain' or 'sameip'
* @returns {Promise<ResultEntry[]>}
*/
module.exports = async (query, queryType) => {
let baseUrl = 'https://rapiddns.io/s';
if (queryType === 'subdomain') {
baseUrl = 'https://rapiddns.io/subdomain';
} else if (queryType === 'sameip') {
baseUrl = 'https://rapiddns.io/sameip';
}
const endpoint = `${baseUrl}/${query}?full=1&down=1`;
try {
const response = await axios.get(endpoint, {
timeout: 30 * 1000,
headers: {
'User-Agent': userAgent
}
});
return getResultEntries(response.data)
.map((entry) => {
const [domain, address, type, date] = entry;
return {
domain,
address,
type,
date
};
});
} catch (e) {
const newE = new Error('RAPIDDNS-IO-SCRAPPER: Exception');
newE.code = 'RAPIDDNS-IO-SCRAPPER-EXCEPTION';
newE.originalE = e;
throw newE;
}
};

14

package.json
{
"name": "rapiddns-io-scrapper",
"version": "0.0.2",
"version": "0.1.0",
"description": "Node.js module to scrape and extract result from rapiddns.io",
"main": "lib/index.js",
"main": "./lib/index.js",
"module": "./lib/index.js",
"scripts": {
"test": "mocha --bail --recursive test",
"test-watch": "mocha --watch --bail --recursive test",
"postversion": "git push && git push --tags",
"version": "auto-changelog -p && git add CHANGELOG.md"
"version": "auto-changelog -p && git add CHANGELOG.md; cp -fv .gitignore .npmignore; echo >> .npmignore; cat npmignore-list >> .npmignore; git add .npmignore"
},

@@ -34,3 +36,9 @@ "repository": {

"should": "^13.2.3"
},
"engines": {
"node": ">=16"
},
"dependencies": {
"axios": "^1.6.5"
}
}

@@ -1,2 +0,6 @@

# node-rapiddns-io-scrapper
# RapidDNS scrapper
[![Version npm](https://img.shields.io/npm/v/rapiddns-io-scrapper)](https://www.npmjs.com/package/rapiddns-io-scrapper)
[![node.js version](https://img.shields.io/node/v/rapiddns-io-scrapper)](https://www.npmjs.com/package/rapiddns-io-scrapper)
Node.js module to scrape and extract result from [rapiddns.io](https://rapiddns.io) (unofficial).

@@ -3,0 +7,0 @@

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