Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
is-url-superb
Advanced tools
The is-url-superb npm package is a simple utility for validating URLs. It checks if a given string is a valid URL, making it useful for input validation, form handling, and other scenarios where URL validation is required.
URL Validation
This feature allows you to check if a given string is a valid URL. The function returns true if the string is a valid URL and false otherwise.
const isUrlSuperb = require('is-url-superb');
const url = 'https://www.example.com';
console.log(isUrlSuperb(url)); // true
The 'validator' package is a library of string validators and sanitizers. It includes a function `isURL` that can be used to validate URLs. Compared to is-url-superb, 'validator' offers a broader range of validation and sanitization functions, making it a more versatile choice for comprehensive input validation.
The 'valid-url' package provides simple URL validation functions. It includes methods like `isUri` and `isWebUri` to check if a string is a valid URI or web URI, respectively. While 'valid-url' offers more specific URL validation methods, it is similar in scope to is-url-superb.
The 'url-regex' package provides a regular expression for matching URLs in strings. It can be used to find and validate URLs within larger text bodies. Unlike is-url-superb, which focuses on simple validation, 'url-regex' is more suited for extracting URLs from text.
Check if a string is a URL
$ npm install is-url-superb
import isUrl from 'is-url-superb';
isUrl('https://sindresorhus.com');
//=> true
isUrl('unicorn');
//=> false
Type: object
Type: boolean
Default: false
Allow URLs without a protocol.
import isUrl from 'is-url-superb';
isUrl('example.com');
//=> false
isUrl('example.com', {lenient: true});
//=> true
FAQs
Check if a string is a URL
The npm package is-url-superb receives a total of 1,123,247 weekly downloads. As such, is-url-superb popularity was classified as popular.
We found that is-url-superb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.