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( 'jane.doe@ups.com' );
// returns 'UPS'
If provided an email from a personal email service, the function will return 'Personal'
.
const out = emailToInstitution( 'john.doe@hotmail.com' );
// 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( 'jane.doe@ups.com', map );
const emailToInstitution = require( '@isle-project/email-to-institution' );
let out = emailToInstitution( 'isle@stat.cmu.edu' );
// returns 'Carnegie Mellon University'
out = emailToInstitution( 'jane.doe@gs.com' );
// returns 'Goldman Sachs Group'
out = emailToInstitution( 'admin@kymetis.com' );
// returns 'Kymetis'
out = emailToInstitution( 'anton@hotmail.com' );
// returns 'Personal'