Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

366
Views
Check email domain type (personal email or company email)

Example

isPersonalEmail("name@gmail.com") // true
isPersonalEmail("name@companyName.com") // false

I can't find NPM package do that I need to check email in node.js server

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found two npm packages that you can use to achieve that:

Free Email Domains by Kiko Beats

The package is based on HubSpot-blocked domains

Email Providers by derhuerst

Provides the same solution, with the advantage of having the option to use all 4k domains in the list, or the 312 common domains only. he defines common as follows:

common.json contains those with an Majestic Million rank of < 100000.


Full Solution

I also stumbled upon a relevant issue that you might want to consider when you extract the domain.

const emailProviders = require("email-providers/all.json")
const parser = require('tld-extract');
const validator = require('validator');

const companyEmail = "name@companyName.com"
const personalEmail = "name@gmail.com"
const personalEmailWithSubdomain = "name@abc.gmail.com"

// 1. You should validate that the string is an actual email as well
// if (!validator.isEmail(email)) return error or something...

const isPersonalEmail = (email) => {

    // 2. Extract the domain
    const broken = email.split('@')
    const address = `http://${broken[broken.length - 1]}`
    const { domain } = parser(address);

    // 3. And check!
    return emailProviders.includes(domain)
}

console.log(isPersonalEmail(companyEmail)) // false
console.log(isPersonalEmail(personalEmail)) // true
console.log(isPersonalEmail(personalEmailWithSubdomain)) // true
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!