npm.io
1.0.0 • Published 11 years ago

swot-simple

Licence
ISC
Version
1.0.0
Deps
1
Vulns
0
Weekly
0
Stars
15
DeprecatedThis package is deprecated

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

API

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('me@gmail.com'); // false
swot.isAcademic('lee@harvard.edu'); // true
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('lreilly@cs.strath.ac.uk');
// "lreilly@cs.strath.ac.uk"

Build Process

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

Keywords