An open API service indexing awesome lists of open source software.

https://github.com/bredele/email-suggest

Suggest email address based on list of popular email domains
https://github.com/bredele/email-suggest

autocomplete email suggestion

Last synced: about 1 month ago
JSON representation

Suggest email address based on list of popular email domains

Awesome Lists containing this project

README

          

# email-suggest

[![NPM](https://img.shields.io/npm/v/email-suggest.svg)](https://www.npmjs.com/package/email-suggest)
[![Downloads](https://img.shields.io/npm/dm/email-suggest.svg)](http://npm-stat.com/charts.html?package=email-suggest)

Suggest email address based on the [most popular email domain](https://github.com/bredele/email-domain-popular)

## Installation

```shell
npm install email-suggest
```

## Usage

```js
import suggest from "email-suggest";

suggest("hello@gm");
// => hello@gmail.com

suggest("world@go");
// => world@google.com

suggest("hello@ao");
// => hello@aol.com

// get list of all suggest domains
suggest("hello@ao", (address, domains) => {
console.log(domains);
// => ['aol.com', 'aol.it']
});

// no suggestion
suggest("hello@zzp");
// undefined

// custom list of suggestions
suggest("hello@w", undefined, ["world.com", "olivier.com"]);
// => hello@world.com

// custom list of suggestions
suggest("hello@g", undefined, ["world.com", "olivier.com"], true);
// => hello@gmail.com
suggest("hello@console.warn();", undefined, ["world.com", "olivier.com"], true);
// => hello@world.com
```