1.0.1 • Published 2 years ago

llibemailaddress v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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('luke.rief@gmail.com', 'Luke Rieff');
const address3 = EmailAddress.decode('"Luke Rieff" <luke.rieff@gmail.com>');

console.log(address1.encode());
/* Luke Rieff <luke.rieff@gmail.com> */
console.log(address2.address)
/* luke.rieff@gmail.com */