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

@reacherhq/api

v0.3.10

Published

Check if an email address exists without sending any email.

Downloads

28

Readme

What is it?

Check if an email address exists without sending any email.

@reacherhq/api is a thin TypeScript wrapper around the Reacher Email Verification API. Reacher is a 100% open-source SaaS, written in Rust. It's also free for personal use, and the API token in @reacherhq/api is optional, but without it the requests will be rate-limited to 50 per month.

Usage

Install the package:

yarn add @reacherhq/api # Or npm install @reacherhq/api

There are two ways to use the library: by sending single API requests, or by using batch verification (parallel queue).

1. Single Email Verification

import { checkSingle } from '@reacherhq/api';

checkSingle(
	{ to_email: '[email protected]' },
	{
		// Required.
		apiToken: '<YOUR_TOKEN>',
	}
).then(console.log); // Output will be the JSON described in the "JSON Output" section below.

2. Batch Email Verification

import { batchQueue } from '@reacherhq/api';

// Create a queue for email verifications.
const q = batchQueue({
	// Required.
	apiToken: '<YOUR_TOKEN>',
	// Optional, callback to call on each successful verification.
	onSuccessSingle: (result) => {
		console.log(
			`Verified email ${result.input}: the result is ${result.is_reachable}.`
		);
	},
});

// Push some data into the queue. The email verification will start as soon as
// it's in the queue. The queue has a default concurrency of 100.
q.push({ to_email: '[email protected]' });
q.push({ to_email: '[email protected]' }, { to_email: '[email protected]' });

// Perform some action when the queue is drained.
q.drain(() => {
	console.log('Finished processing all items.');
});

JSON Output

The output will be a JSON with the below format, the fields should be self-explanatory. For [email protected] (note that it is disabled by Gmail), here's the exact output:

{
	"input": "[email protected]",
	"is_reachable": "invalid",
	"misc": {
		"is_disposable": false,
		"is_role_account": false
	},
	"mx": {
		"accepts_mail": true,
		"records": [
			"alt3.gmail-smtp-in.l.google.com.",
			"gmail-smtp-in.l.google.com.",
			"alt1.gmail-smtp-in.l.google.com.",
			"alt4.gmail-smtp-in.l.google.com.",
			"alt2.gmail-smtp-in.l.google.com."
		]
	},
	"smtp": {
		"can_connect_smtp": true,
		"has_full_inbox": false,
		"is_catch_all": false,
		"is_deliverable": false,
		"is_disabled": true
	},
	"syntax": {
		"domain": "gmail.com",
		"is_valid_syntax": true,
		"username": "someone"
	}
}

You can also take a look at the OpenAPI v3 specification of this JSON object.

License

The source code is available under the Apache-2.0 license. See the LICENSE file for more info.