Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

isurl

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isurl

Determines whether a value is a WHATWG URL.

  • 4.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-7.21%
Maintainers
1
Weekly downloads
 
Created

What is isurl?

The 'isurl' npm package is a utility library designed to provide a simple and efficient way to validate and manipulate URLs in Node.js applications. It offers functions to check if a given string is a valid URL and to parse URLs into their components.

What are isurl's main functionalities?

URL Validation

This feature allows developers to check if a string is a valid URL. It returns true if the string is a valid URL and false otherwise. This is useful for validating user input or data fetched from external sources.

const isUrl = require('isurl');

console.log(isUrl('https://www.example.com')); // true
console.log(isUrl('not-a-url')); // false

URL Parsing

This feature provides the ability to parse a URL into its constituent parts, such as protocol, host, path, and query string. This can be particularly useful for applications that need to manipulate or extract information from URLs.

const isUrl = require('isurl');
const url = isUrl.parse('https://www.example.com/path?query=123');

console.log(url.protocol); // 'https:'
console.log(url.host); // 'www.example.com'
console.log(url.pathname); // '/path'
console.log(url.search); // '?query=123'

Other packages similar to isurl

Keywords

FAQs

Package last updated on 27 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc