url-inspector-arham
v1.0.1
Published
Inspect URLs for DNS, SSL, headers, and performance.
Maintainers
Readme
URL Inspector
A lightweight and developer-friendly Node.js library for inspecting URLs. Easily retrieve information about redirects, response headers, DNS records, SSL certificates, response times, and more through a simple API.
Github
https://github.com/DefNotArham/url-inspector-arham-npm
Features
- 🔍 Inspect any URL
- 🔀 Track redirect chains
- 📡 Retrieve HTTP response headers
- 🔒 Inspect SSL certificate information
- 🌐 Perform DNS lookups
- ⏱️ Measure response time
- 🛡️ Analyze common security headers
- 📦 Lightweight with minimal dependencies
- 💙 Full TypeScript support
Installation
npm install url-inspectorUsage
import { inspect } from "url-inspector";
const result = await inspect("https://example.com");
console.log(result);Example output:
{
"url": "https://example.com",
"status": 200,
"responseTime": 74,
"redirects": [],
"headers": {
"content-type": "text/html; charset=UTF-8"
},
"ssl": {
"valid": true,
"issuer": "Let's Encrypt"
}
}API
inspect(url, options?)
Inspects a URL and returns useful information about the request.
Parameters
| Name | Type | Description |
| --------- | -------- | ------------------------------- |
| url | string | The URL to inspect. |
| options | object | Optional configuration options. |
Returns
Returns a Promise containing information about the inspected URL, including:
- HTTP status
- Response time
- Response headers
- Redirect chain
- SSL certificate details
- DNS information (if enabled)
Use Cases
- Validate URLs before storing them
- Check website availability
- Monitor response times
- Analyze redirects
- Inspect SSL certificates
- Debug API endpoints
- Build uptime monitoring tools
Requirements
- Node.js 18 or newer
Contributing
Contributions are welcome!
If you'd like to contribute:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Commit your changes.
- Open a pull request.
If you find a bug or have a feature request, feel free to open an issue.
License
This project is licensed under the MIT License.
