eh-url
Advanced tools
Comparing version 1.0.2 to 2.0.0
@@ -1,1 +0,3 @@ | ||
module.exports = require('./src/eh-url'); | ||
const { UrlController } = require('./src/controllers'); | ||
module.exports = UrlController; |
{ | ||
"name": "eh-url", | ||
"displayName": "eh-url", | ||
"version": "1.0.2", | ||
"description": "Node package to check whether a string is a URL", | ||
"version": "2.0.0", | ||
"description": "Node.js package for check whether a string is a URL", | ||
"author": "Giovani de Oliveira <giovanioliveira@outlook.com.br>", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"eslint": "^6.8.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
@@ -30,0 +30,0 @@ "eslint-plugin-import": "^2.20.0" |
# eh-url | ||
Node package to check whether a string is a URL. | ||
Node.js package for check whether a string is a URL. | ||
@@ -8,3 +8,6 @@ <p align="center"> | ||
### Installation | ||
# Prerequisites | ||
* [Node.js](https://nodejs.org/en/) | ||
# Installation | ||
```` | ||
@@ -16,37 +19,19 @@ npm install eh-url | ||
```javascript | ||
const ehUrl = require('eh-url'); | ||
const EhUrl = require('eh-url'); | ||
ehUrl('https://google.com.br/').then((response) => { | ||
console.log(response); | ||
}).catch((error) => { | ||
console.error(error); | ||
}); | ||
const ehUrl = new EhUrl(); | ||
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); | ||
}); | ||
(async () => { | ||
const url = await ehUrl.check('https://google.com.br/'); | ||
console.log(url); | ||
})(); | ||
``` | ||
### Response example | ||
```` | ||
true | ||
false | ||
true | ||
```` | ||
### Built With | ||
# Built With | ||
* [Node.js](https://nodejs.org/en/) | ||
### Authors | ||
* **Giovani de Oliveira** - [xxgicoxx](https://github.com/xxgicoxx) | ||
# Authors | ||
* [xxgicoxx](https://github.com/xxgicoxx) | ||
### Acknowledgments | ||
* [FlatIcon](https://www.flaticon.com/) - Icon | ||
# Acknowledgments | ||
* [FlatIcon](https://www.flaticon.com/) |
4369
9
43
35