Skip to content

Commit

Permalink
Merge pull request #102 from Nisarg155/master
Browse files Browse the repository at this point in the history
added is-url
  • Loading branch information
MEHTAUDIT authored Oct 19, 2023
2 parents 448bd1b + 05bf7b8 commit 7cdf7c3
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 213 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ So, What are you waiting for? 🤔
| **H** | | |
| | [Husky](./npm_Modules/Husky/) | [npm Husky](https://www.npmjs.com/package/husky) | [docs Husky](https://typicode.github.io/husky/) |
| **I** | | |
| | [is-URL](./npm_Modules/isURL/) | [npm_is-url](https://www.npmjs.com/package/is-url?activeTab=readme) | |
| **J** | | |
| | [Jsonwebtoken](./npm_Modules/jsonwebtoken/) | [npm Jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken) | |
| **K** | | |
Expand Down
20 changes: 20 additions & 0 deletions npm_Modules/isURL/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# is-url

Check whether a string is a URL.

## Installation

```sh
npm install is-url
```

## API

### `isUrl(string)`

Returns a Boolean indicating whether `string` is a URL.

## License

MIT
18 changes: 18 additions & 0 deletions npm_Modules/isURL/isurl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const isUrl = require('is-url');

// Test URLs
const validUrl = 'https://www.example.com';
const invalidUrl = 'not a valid url';

// Check if a URL is valid
if (isUrl(validUrl)) {
console.log(`${validUrl} is a valid URL.`);
} else {
console.log(`${validUrl} is not a valid URL.`);
}

if (isUrl(invalidUrl)) {
console.log(`${invalidUrl} is a valid URL.`);
} else {
console.log(`${invalidUrl} is not a valid URL.`);
}
Loading

0 comments on commit 7cdf7c3

Please sign in to comment.