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

be-url

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

be-url

validate url

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

be-url

Check whether a string is a URL.

Installation

npm install be-url

API

Usage

import isUrl from 'be-url'

const valid = isUrl('https://www.example.com/test.html')

isUrl(string, opt)

Returns a Boolean indicating whether string is a URL.

opt

Example: consider example.com as invalid url

{
  exclude: {
    domain: 'example.com',
  }
}

Example: consider undefined in path as invalid url

{
  exclude: {
    path: 'undefined',
  }
}

License

MIT

Credit to is-url

This library is inspired by is-url, but with more options, please refer to is-url at https://github.com/segmentio/is-url

Keywords

FAQs

Package last updated on 09 Aug 2023

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