llibemailaddress
v1.0.1
Published
Simple E-Mail address class / parser, which I can share across projects.
Downloads
1
Readme
Luke Email-Address Library
Simple E-Mail address class / parser, which I can share across projects.
Usage
import { EmailAddress } from 'llibemailaddress';
const address1 = new EmailAddress(
'luke.rieff', /* Username */
'gmail.com', /* Hostname */
'Luke Rieff' /* Name */
);
const address2 = EmailAddress.fromAddress('[email protected]', 'Luke Rieff');
const address3 = EmailAddress.decode('"Luke Rieff" <[email protected]>');
console.log(address1.encode());
/* Luke Rieff <[email protected]> */
console.log(address2.address)
/* [email protected] */