Skip to content

identify education email addresses worldwide: a simple, fast implementation of Swot in JavaScript

License

Notifications You must be signed in to change notification settings

mapbox/swot-simple

Repository files navigation

swot-simple

build status

Simple & fast JavaScript implementation of Swot

  • only depends on tldjs
  • compiles swot data into a single json file, so bootup is fast
  • passes all of Swot's tests.
  • fast

Install

npm install swot-simple

isAcademic(email)

Check an email for whether it is from an educational domain or not.

Parameters

parameter type description
email String a full email address

Example

swot.isAcademic('[email protected]'); // false
swot.isAcademic('[email protected]'); // true

Returns boolean, whether the email is educational

getInstitutionName(email)

Check an email for whether it is from an educational domain or not, and if it is a known educational institution, return its name.

Parameters

parameter type description
email String a full email address

Example

swot.getInstitutionName('[email protected]');
// "University of Strathclyde"

Returns boolean,String, false, if the email is not educational. otherwise, a string describing the domain.

Build Process

swot's main data is transformed by build.js. The list of tlds is transformed from the Ruby to json by hand.

About

identify education email addresses worldwide: a simple, fast implementation of Swot in JavaScript

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published