@mapbox/swot-simple

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @mapbox/swot-simple

Weekly Downloads

4

Version

1.0.0

License

ISC

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user