is-educational-email-domain
Check if an email domain belongs to an educational institution.
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');
hasCommonEducationalTld('u-tokyo.ac.jp');
hasCommonEducationalTld('cuhk.edu.cn');
hasCommonEducationalTld('bla.cc');
hasAdhocEducationalTld('math.ethz.cz');
hasAdhocEducationalTld('stanford.edu');
isEducationalEmailDomain('stanford.edu');
isEducationalEmailDomain('math.ethz.cz');
isEducationalEmailDomain('bla.cc');
})()