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 🙏

© 2026 – Pkg Stats / Ryan Hefner

email-domain-classifier

v0.1.0

Published

TypeScript client and shared protocol for the email-domain-classifier service.

Downloads

660

Readme

email-domain-classifier

TypeScript client and shared wire protocol for the email-domain-classifier service, which classifies an email domain as free, disposable, or unknown.

Install

bun add email-domain-classifier effect

effect is an optional peer — required by the root, ./promises, and ./effect entry points. ./protocol is dependency-free.

Usage

The namespace is EmailDomains and the operation is classify, so a call site reads as EmailDomains.classify(...).

category is free | disposable | business | unknown. This service never emits business — it is reserved for the consumer's own downstream classifier — so unknown means "not in either list", not "business".

Promises

import { createClient, EmailDomains } from "email-domain-classifier/promises";

// Zero-config, against the hosted service.
const result = await EmailDomains.classify("[email protected]");
result.category; // "free" | "disposable" | "unknown"

// Configured client.
const classifier = createClient({ timeoutMs: 1500 });
const results = await classifier.classifyMany(["[email protected]", "[email protected]"]);

classify accepts a bare domain, an email, or a URL. classifyMany chunks at the contract limit and preserves order. Failures reject with the shared errors:

import { HttpError, NotSeededError } from "email-domain-classifier/promises";

Effect

import { Effect } from "effect";
import { EmailDomains } from "email-domain-classifier/effect";

const program = Effect.gen(function* () {
  const domains = yield* EmailDomains.Service;
  return yield* domains.classify("[email protected]");
});

program.pipe(Effect.provide(EmailDomains.layerFetch({})));

EmailDomains.layer requires an HttpClient; EmailDomains.layerFetch provides the Fetch transport. Errors are Schema.TaggedErrors, so recover with Effect.catchTag:

yield* EmailDomains.classify(email).pipe(
  Effect.catchTag("EmailDomains.NotSeededError", () => fallThroughToContextDev),
);

The service does not impose a timeout or status retry policy; compose Effect.timeout and retry in the caller. Transport failures are retried transiently at the boundary.

Protocol

email-domain-classifier/protocol exports the shared wire types and constants with no runtime dependencies:

import { MAX_BATCH_SIZE, type Classification } from "email-domain-classifier/protocol";

Errors

| Error | Meaning | | --- | --- | | EmailDomains.NetworkError | Transport failure (connection, DNS, TLS, abort) | | EmailDomains.TimeoutError | A caller-composed timeout elapsed | | EmailDomains.HttpError | Non-2xx status other than 503 (carries status) | | EmailDomains.NotSeededError | 503 — the service is up but its lists are not seeded | | EmailDomains.DecodeError | A 2xx body did not match the contract |

License

MIT