goturl
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");
extractUrl("Website: another-one.com");
extractUrl("Don't forget about this.com/thing?query=string", { fallbackProtocol: 'https' });
extractUrl("Check out our promotions: http://promotion.com http://promotion.com/real/offer", { getLongestUrl: true });
extractUrl("Quick reminder, check out our websitehttps://hurry.com/mistake", { tryFixProtocol: true });
Testing
yarn test