Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anonymitybot/is-educational-email-domain

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anonymitybot/is-educational-email-domain

Check if an email domain belongs to an educational instutition

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

is-educational-email-domain

Check if an email domain belongs to an educational institution.

CircleCI Coverage Status version

Why?

We offer AnonymityBot for free for educational workspaces but couldn't find an efficient way to detect email domains of educational institutions.

Why Open Source?

Why not?

We’ve been students and lecturers ourselves and personally felt the communicational hardships affecting both sides (the fear of being ridiculed for asking a question, the moment no one asks questions - not knowing if they got it, etc.) and therefore think that more software should offer Pro Bono tiers for educational purposes.

For this reason, we decided to open source our software that automatically detects if an email domain belongs to an educational institution.

You can read more here.

API

hasCommonEducationalTld(domain)

We call a TLD Common Educational TLD if it is either .edu, .edu.xx or .ac.xx and was fetched from publicsuffix.org.

hasAdhocEducationalTld(domain)

Some institutions don't use edu or ac TLDs, and (usually) use their own country code. For instance, University of Oslo has an email domain for each department - math.uio.no, fys.uio.no - in order to capture all such departments we simply check for uio.no.

isEducationalEmailDomain(domain)

Combines hasCommonEducationalTld and hasAdhocEducationalTld:

const isEducationalEmailDomain = (domain) =>
  hasCommonEducationalTld(domain) || hasAdhocEducationalTld(domain);

Where is the data coming from?

See ./assets.

Example

Install with yarn add @anonymitybot/is-educational-email-domain:

const {
  isEducationalEmailDomain,
  hasAdhocEducationalTld,
  hasCommonEducationalTld,
} = require('@anonymitybot/is-educational-email-domain');

(async () => {
  hasCommonEducationalTld('stanford.edu'); // true
  hasCommonEducationalTld('u-tokyo.ac.jp'); // true
  hasCommonEducationalTld('cuhk.edu.cn'); // true

  hasCommonEducationalTld('bla.cc'); // false - .ac is a ccTLD

  hasAdhocEducationalTld('math.ethz.cz'); // true - etch.cz is an ad-hoc educational domain
  hasAdhocEducationalTld('stanford.edu'); // false - .edu is a common educational tld (but not an ad-hoc one)

  isEducationalEmailDomain('stanford.edu'); // true
  isEducationalEmailDomain('math.ethz.cz'); // true

  isEducationalEmailDomain('bla.cc'); // false - .ac is a ccTLD
})()

Keywords

FAQs

Package last updated on 29 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc