parse-email-address - v0.0.2
    Preparing search index...

    Function parseEmailAddress

    • Parse an email address into parts.

      This uses parse from smtp-address-parser v1.1.0.

      Parameters

      • emailAddress: undefined | string

      Returns undefined | ParsedEmailAddress

      undefined if the given email address is invalid.

      import {parseEmailAddress} from 'parse-email-address';

      const result1 = parseEmailAddress('simple@example.org');
      // result1 is `{user: 'simple', domain: 'example.org', full: 'simple@example.org'}`

      const result2 = parseEmailAddress('tld-too-short@foo.x');
      // result2 is `undefined`

      Nothing, this will never throw an error.