Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sefinek committed Dec 24, 2023
1 parent 6040cc1 commit 25938a1
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ yarn add email-validator
```


## 🤔 » Node.js example
```js
const emailValidator = require('email-validator');
const testEmail = 'contact@sefinek.net';

if (emailValidator.test(testEmail)) {
console.log(`Email ${testEmail} is valid!`);
} else {
console.log(`Email ${testEmail} is NOT valid!`);
}
```


## 🌍 » Browser
### cdn.sefinek.net
```
Expand All @@ -36,28 +49,25 @@ https://cdn.jsdelivr.net/gh/sefinek24/email-validator@latest/dist/validator.js
<!DOCTYPE html>
<html lang="en">
<head>
<title>email-validator</title>
<meta charset="utf-8">
</head>
<body>

<h1>email-validator</h1>

<script src="https://cdn.sefinek.net/npm/email-validator/dist/validator.js"></script>
<script>
if (emailValidator.test(email)) {
console.log(`✔️ Email ${email} is valid.`;
} else {
console.log(`❎ Email ${email} is NOT valid!`);
}
</script>
</body>
</html>
```
## 🤔 » Example
```js
const emailValidator = require('email-validator');
const testEmail = 'contact@sefinek.net';

if (emailValidator.test(testEmail)) {
console.log(`Email ${testEmail} is valid!`);
} else {
console.log(`Email ${testEmail} is NOT valid!`);
}
```


## ⭐ » Thank you
If you find this module helpful, please consider giving the [repository a star](https://github.com/sefinek24/email-validator).
For any questions or issues, please create a new [Issue](https://github.com/sefinek24/email-validator/issues/new).
Expand Down

0 comments on commit 25938a1

Please sign in to comment.