A utility function to check if an email address matches a free email provider.
import isFreeEmail from '@withe/is-free-email';
const expectTrue = isFreeEmail('someone@gmail.com'); // Returns true
const expectFalse = isFreeEmail('someone@acme.com'); // Returns false
This package also provides a Go implementation.
package main
import "github.com/withevideo/email"
var expectTrue, _ = email.IsFree("someone@gmail.com"); // Returns true
var expectFalse, _ = email.IsFree("someone@acme.com"); // Returns false
var _, err = email.IsFree("this_seems_bad"); // err === "invalid email address"
$ npm run generate
$ npm run test
$ npm run build