1.0.9 ā€¢ Published 2 years ago

email-genie v1.0.9

Weekly downloads
3
License
ISC
Repository
github
Last release
2 years ago

Email Genie

Allows autocomplete on email field by providing a list of domain suggestions (gmail.com, outlook.com, etc.). This package is lightweight, flexible, compatible with libraries (jQuery, etc.) / frameworks (React, Angular, Vue, etc.) and maximize native behaviors on desktop AND mobile browsers.

šŸ‘ Lite 5kb (2kb Gzipped) āš” Fast Native JavaScript šŸš« No Dependencies šŸš« No HTML Wrapper šŸš« No CSS injected

Examples

Installation

npm i email-genie

Import

CDN

<script src="https://unpkg.com/email-genie"></script>;

Classic

const EmailGenie = require('email-genie');

ES6

import EmailGenie from 'email-genie';

Usage

Text selector

const email = new EmailGenie('.email');

Vanilla JS

const elem = document.querySelector('.email')
const field = new EmailGenie(elem);

jQuery

const field = new EmailGenie($('.email'));

Add custom domains

const field = new EmailGenie('.email', {
  domains: ['business.com', 'company.com', 'university.com'],
});

Options

OptionDefaultPossibilitiesDescription
domains'gmail.com', 'outlook.com', 'hotmail.com', 'msn.com', 'live.com', 'googlemail.com', 'yahoo.com', 'me.com', 'icloud.com'[]Array of domains suggestions. (By default, this array will be added to the default domains suggestions. View overrideDomains option to override instead.)
overrideDomainsfalseBoolean (true/false)Wether the domains suggestions array should override the default one.
insert'afterend''beforebegin', 'afterend', 'documentend'Where the datalist generated should be inserted: Before the input, after the input, at the end of the document.

Support

Chrome, Firefox, Safari, Edge, IE 11

1.0.9

2 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago