# @mapbox/swot-simple

> detect whether an email address is under an edu domain

Latest version **1.0.0** (published 2016-12-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mapbox/swot-simple
pnpm add @mapbox/swot-simple
yarn add @mapbox/swot-simple
bun add @mapbox/swot-simple
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-12-22 |
| First published | 2016-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom MacWright, Contributors, SWOT originally by Lee Reilly |
| Maintainers | mapbox-admin |
| Keywords | swot, email, edu |

## Links

- npm: https://www.npmjs.com/package/@mapbox/swot-simple
- Repository: https://github.com/mapbox/swot-simple
- Homepage: https://github.com/mapbox/swot-simple#readme
- Issues: https://github.com/mapbox/swot-simple/issues
- npm.io page: https://npm.io/package/@mapbox/swot-simple

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^5.0.3
- [tldjs](https://npm.io/package/tldjs.md) ^1.5.2
- [uglify-js](https://npm.io/package/uglify-js.md) ^2.4.16

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-12-22

## README

# swot-simple

[![build status](https://secure.travis-ci.org/mapbox/swot-simple.png)](http://travis-ci.org/mapbox/swot-simple)

Simple & fast JavaScript implementation of [Swot](https://github.com/leereilly/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

```js
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

```js
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](https://github.com/leereilly/swot/blob/master/lib/swot/academic_tlds.rb) to
[json](tlds.json) by hand.

---
_Source: https://npm.io/package/@mapbox/swot-simple · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
