arham-url-validator
v1.0.4
Published
A simple URL validation package for JavaScript and TypeScript
Maintainers
Readme
🔗 Arham URL Validator
A lightweight TypeScript utility to validate URLs.
Checks whether a given string is a valid HTTP or HTTPS URL.
📦 Installation
npm install arham-url-validator🚀 Usage
JavaScript / TypeScript
import { isValidUrl } from "arham-url-validator";
console.log(isValidUrl("https://google.com"));
// true
console.log(isValidUrl("hello"));
// false✨ Features
- ✅ TypeScript support
- ✅ Lightweight
- ✅ No dependencies
- ✅ Supports HTTP and HTTPS URLs
- ✅ Simple API
📖 API
isValidUrl(url)
Checks if a URL is valid.
Parameters
| Parameter | Type | Description | | --------- | ------ | ---------------------------- | | url | string | The URL you want to validate |
Returns
boolean
true→ Valid URLfalse→ Invalid URL
Example:
isValidUrl("https://github.com");
// true
isValidUrl("not-a-url");
// false🛠️ Built With
- TypeScript
- Node.js
📄 License
MIT License
