Skip to content

Tiny library for checking email address whether it's valid or not

Notifications You must be signed in to change notification settings

woicip/check-email-address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check-email-address

Tiny library for checking email address whether it's valid or not with support of TypeScript
Support in CJS, ESM and React App

Use Case

It's great for you to work with email form in web. Don't need to make from scratch ... just install it into your project

Installation

npm install check-email-address 

or

yarn add check-email-address

Usage

Common JS

// CJS (Common JS)
const checkEmailAddress = require('check-email-address')

const emailAddr = 'myEmail@mail.com'
const { isValid } = checkEmailAddress(emailAddr)

if(isValid){
    console.log("Email valid")
} else {
    console.log("Email is not valid")
}

ES Modules

// ESM (ES Modules)
import checkEmailAddress from 'check-email-address'

const emailAddr = 'myEmail@mail.com'
const { isValid } = checkEmailAddress(emailAddr)

if(isValid){
    console.log("Email valid")
} else {
    console.log("Email is not valid")
}

React App

// React App (TSX)
import checkEmailAddress from 'check-email-address'

export default function Component(props: any){
    ...
    const { isValid }: { isValid: boolean } = checkEmailAddress(email)
    ...
}

About

Tiny library for checking email address whether it's valid or not

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published