google-domains
v0.0.3
Published
Get google domains randomly to prevent being block
Downloads
2
Readme
Google Domains
Get Google domains.
Requirements
| Item | Details | | ----------- | ------------------------------------------------------------ | | System | GNU/Linux (>=2.6.x), macOS (>=10.10.x), Windows (later than XP) | | Environment | Node.js >= 8.2.0 |
Installation
# under product mode
$ npm install google-domains --save
# under development mode
$ npm install google-domains --save-dev
Quick Start
After you finished the installation above, you will have a package google-domains
in your ./node_modules
directory.
Import
Default module exports in CommonJS style
const GoogleDomains = require('google-domains');
const googleDomains = new GoogleDomains();
Usages
googleDomains.fetch()
Returns a Promise object that contains all known Google domains.
Recommanded usage:
let data;
try {
data = await googleDomains.fetch();
} catch (error) {
throw new Error(error);
}
or alternatively:
googleDomains.fetch()
.then(function (data) {
// get proxies here
})
.catch(function (error) {
throw new Error(error);
});
googleDomains.random()
Get an object of Google domain information randomly.
Recommanded usage:
let data;
try {
data = await googleDomains.random();
} catch (error) {
throw new Error(error);
}
or alternatively:
googleDomains.random()
.then(function (data) {
// get data here
})
.catch(function (error) {
throw new Error(error);
});
googleDomains.randomUrl()
Get a string of Google url randomly.
Recommanded usage:
let data;
try {
data = await googleDomains.randomUrl();
} catch (error) {
throw new Error(error);
}
or alternatively:
googleDomains.randomUrl()
.then(function (data) {
// get data here
})
.catch(function (error) {
throw new Error(error);
});
Tests
To run the test suite, go to the root directory of this package, and install dependencies, and then run npm test
or npm run test
:
$ cd /path/to/google-domains
$ npm install
$ npm test
# or
$ npm run test