Free Email DomainsAPI

API

API Reference

isFreeEmail(email: string, options?): boolean

Check if an email address is from a free email provider.

Parameters:

  • email (string): Email address to check
  • options? (Set<string> | FreeEmailOptions): Additional free domains, or an options object with allowDomains/customDomains

Returns: true if free, false otherwise

Example:

isFreeEmail("user@gmail.com"); // true
isFreeEmail("ceo@my-company.com"); // false

isFreeDomain(domain: string, options?): boolean

Like isFreeEmail but accepts a bare domain rather than a full email address.

isFreeDomain("gmail.com"); // true

areFreeEmails(emails: string[], options?): Map<string, boolean>

Check multiple email addresses at once. Returns a Map of email to boolean.

extractDomain(email: string): string | undefined

Returns the normalized (lowercased, trimmed) domain of an email address, or undefined if invalid.

setDomains(domains: ReadonlyArray<string>): void

Inject the free-domain list explicitly, bypassing the Node filesystem loader (edge/browser/bundled runtimes).

preload(): Promise<void>

Eagerly load the built-in list so the first check does not stall the event loop.

isListLoaded(): boolean

Returns true once the built-in list is loaded; false if it has not been accessed yet or failed to load.

./domains subpath

Array of all known free email provider domains.

import domains from "@visulima/free-email-domains/domains" with { type: "json" };

console.log(domains.length);
// 8000+
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues