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
npm install swot-simple
Check an email for whether it is from an educational domain or not.
parameter | type | description |
---|---|---|
email |
String | a full email address |
swot.isAcademic('me@gmail.com'); // false
swot.isAcademic('lee@harvard.edu'); // true
Check an email for whether it is from an educational domain or not, and if it is a known educational institution, return its name.
parameter | type | description |
---|---|---|
email |
String | a full email address |
swot.getInstitutionName('lreilly@cs.strath.ac.uk');
// "lreilly@cs.strath.ac.uk"
swot's main data is transformed by build.js
. The list of tlds is transformed
from the Ruby to
json by hand.