eh-url
Node package to check whether a string is a URL.
Installation
npm install eh-url
Example
const ehUrl = require('eh-url');
ehUrl('https://google.com.br/').then((response) => {
console.log(response);
}).catch((error) => {
console.error(error);
});
ehUrl('google.com').then((response) => {
console.log(response);
}).catch((error) => {
console.error(error);
});
ehUrl('google.com', { protocol: false }).then((response) => {
console.log(response);
}).catch((error) => {
console.error(error);
});
Response example
true
false
true
Built With
Authors
Acknowledgments