Return an institution name corresponding to a supplied email address.
const emailToInstitution = require( '@isle-project/email-to-institution' );
Returns an institution name corresponding to a supplied email address.
const out = emailToInstitution( '[email protected]' );
// returns 'UPS'
If provided an email from a personal email service, the function will return 'Personal'
.
const out = emailToInstitution( '[email protected]' );
// returns 'Personal'
The function accepts an optional custom map of domain names to institution names. Entries in the map take precedence over the default map.
const map = {
'ups.com': 'United Parcel Service'
};
const out = emailToInstitution( '[email protected]', map );
const emailToInstitution = require( '@isle-project/email-to-institution' );
let out = emailToInstitution( '[email protected]' );
// returns 'Carnegie Mellon University'
out = emailToInstitution( '[email protected]' );
// returns 'Goldman Sachs Group'
out = emailToInstitution( '[email protected]' );
// returns 'Kymetis'
out = emailToInstitution( '[email protected]' );
// returns 'Personal'