Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

email-to-name

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-to-name

A Node.js and web browser compatible script that takes an email address and tries to generate a name.

  • 2.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by41.6%
Maintainers
1
Weekly downloads
 
Created
Source

Tests npm bundle size npm

Email to Name

A Node.js and web browser compatible script that takes an email address and tries to generate a name.

image

Company Names

Privacy conscious individuals often use the name of website as the email identifier. If Jane Smith has her own domain name with an email server, she might sign up as suspiciouswebsite@janesmith.com. That way if "Suspicious Website" ends up selling her email address on to a third party, if they send this exact email address spam, it's possible to see who leaked her email address.

It's also therefore possible to invert this method and detect the personal domain if the email identifier matches your company/website name.

No Company Names

  • emailToName.process('acloudguru@janesmith.com')
    • Output: Acloudguru

With Company Names

  • emailToName.process('acloudguru@janesmith.com', { companyNames: ['acg', 'acloudguru'] })
    • Output: Janesmith

Common Email Identifiers

Users who operate a personal email domain sometimes use prefixes like contact, hello, me and others. This script also tries to invert those.

Parameters

ValueDefaultExample (Input)Example (On)Example (Off)
removePlusWordstruetait.brown+test@gmail.comTait BrownTait Brown+test
removeNumberstruetait123@gmail.comTaitTait123
titleCasetruetait.brown@gmail.comTait Browntait brown
caseMctruejohn.mckim@gmail.comJohn McKimJohn Mckim
caseLetterApostrophetrueflannery.o'connor@gmail.comFlannery O'ConnorFlannery O'connor
uppercaseGenerationalNumberstruetait.brown.iii@gmail.comTait Brown IIITait Brown Iii
commaPrependGenerationalPhrasetruetait.brown.jr@gmail.comTait Brown, Jr.Tait Brown Jr
appendPeriodToTitlePrefixtrueprof.tait.brown@gmail.comProf. Tait BrownProf Tait Brown
lowercaseFamilyParticletruedutch.van.der.linde@gmail.comDutch van der LindeDutch Van Der Linde

Default Values

Common Personal Identifiers

Attempt to use the domain name as the personal identifier when these common email identifiers are used 'hello', 'me', 'email', 'contact'

Generational Suffixes

Prepend a comma and append a period for the following, when at the end of a string and preceded by a space 'jr', 'jnr', 'sr', 'snr'

Generational Numbers

Uppercase these whe at the end of a string and preceded by a space 'ii', 'iii', 'iv'

Titles

Append a period when the following occur at the beginning of a string and are followed by a space 'mr', 'mrs', 'ms', 'dr', 'prof'

Development

Run tests. Requires yarn.

yarn test

Changelog

  • 2.0.0 - Building with esbuild with browser targets chrome58,firefox57,safari11,edge16
  • 1.1.0 - Borrowed heavily from namecase libraries
    • ADDED: Various lowercase conjunctions "son/daughter of" as per namecase
  • 1.0.0 Breaking Change: Relocated company names and common personal identifiers to params
  • 0.2.0 Bugfix: Couldn't use in browser due to module check
  • 0.1.0 added generational handling (Jr, Sr, III etc) as well as titles (Mr, Mrs, Dr, Prof)
  • 0.0.0 init commit

FAQs

Package last updated on 29 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc