1.0.0 • Published 7 years ago

hunterio-sdk v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Docs

This is a very thin wrapper on the Hunter.io docs.

Pattern

var HunterSDK = require('hunterio');

var KEY = 'your api key for hunter.io';

var hunter = new HunterSDK(KEY);


hunter.domainSearch({
	domain: 'hubspot.com'
}, function(err, body) {
	if (err) {
		// handle error
	} else {
		// Will contain same body as the raw API call
		console.log(body);
	}
});

More generally, the calls work like this:

Param order:
1. Any path params, as separate params, first.
2. Required, query param hash (include empty object if none)
3. If a POST or PUT, include the body of the request as a plain object
4. The callback to execute on completion.

hunter[<methodNameCamelCase>](
		any path params,
		like an id,
		{
			query: param,
			hash: values
		},
		{
			postBody: orPutBodyIfApplicable
		},
		function callback(err, data) {
			// 
		}
	)