is-mailto
v1.0.3
Published
A function to check if link is a valid 'mailto:'
Downloads
10
Readme
is-mailto
Simple function to test if an url is a valid "mailto:".
Install:
$ npm i is-mailto
$ yarn add is-mailto
Example:
import isMailTo from 'is-mailto';
const string = 'mailto:[email protected]';
console.log(isMailTo(string)) // true
const string = 'test@test';
console.log(isMailTo(string)) // false because it's not an valid email and not contain "mailto:"