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

goturl

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goturl

The library that tries to do its best to extract urls from strings.

  • 3.6.19
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
324
increased by9.83%
Maintainers
1
Weekly downloads
 
Created
Source

goturl

NPM version NPM downloads Fastify

goturl - the library that tries to do its best to extract urls from strings.

Installation

yarn add goturl

Usage

import { extractUrl } from 'goturl';

extractUrl("Visit https://example.com for more info");
// => https://example.com

extractUrl("Website: another-one.com");
// => another-one.com

extractUrl("Don't forget about this.com/thing?query=string", { fallbackProtocol: 'https' });
// => https://this.com/thing?query=string

extractUrl("Check out our promotions: http://promotion.com http://promotion.com/real/offer", { getLongestUrl: true });
// => http://promotion.com/real/offer

extractUrl("Quick reminder, check out our websitehttps://hurry.com/mistake", { tryFixProtocol: true });
// => https://hurry.com/mistake

Testing

yarn test

Keywords

FAQs

Package last updated on 26 Feb 2024

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