12.1.0 • Published 8 months ago

get-urls v12.1.0

Weekly downloads
56,725
License
MIT
Repository
github
Last release
8 months ago

get-urls

Get all URLs in a string

The URLs will be normalized.

Do not use this for any kind of security-related validation.

Please note the known limitation. You can work around this by setting requireSchemeOrWww to true.

Install

npm install get-urls

Usage

import getUrls from 'get-urls';

const text = 'Lorem ipsum dolor sit amet, //sindresorhus.com consectetuer adipiscing http://yeoman.io elit.';

getUrls(text);
//=> Set {'http://sindresorhus.com', 'http://yeoman.io'}

API

getUrls(text, options?)

Returns a Set of URLs.

text

Type: string

options

Type: object

All the normalize-url options in addition to:

extractFromQueryString

Type: boolean\ Default: false

Extract URLs that appear as query parameters in the found URLs.

exclude

Type: string[]\ Default: []

Exclude URLs that match URLs in the given array.

requireSchemeOrWww

Type: boolean\ Default: false

Require URLs to have a scheme or leading www. to be considered an URL. When false, matches against a list of valid TLDs, so it will match URLs like unicorn.education.

Does not affect URLs in query parameters if using the extractFromQueryString option.

Related

@arashgh/insta.js@gov-sec/node.ig@ber4tbey/instavue-url-preview@infinitebrahmanuniverse/nolb-get-u@everything-registry/sub-chunk-1753@androz2091/insta.js@arashgh/insta-js@daisy/books-to-videos@el7cosmos/gatsby-plugin-prefetch-google-fontsfind-urls-in-object@lotus-tree/fxtwitter@lotus-tree/requestcat@lotus-tree/saucenao@artizy-io/strapi-plugin-import-content@ber4tbey/insta.js@bluecadet/launchpad-content@browserstorm/runtime@micropub-endpoint/core@mich4l/link-previewhubot-apple-music-embedig-framework@postr/coregitdown@o/website-appgun-relays@nearest/nearest-fieldlookupgenshin-fandom-scraper@madhu2704/commonfunctionsget-pdf-urlsget-urls-cliget-urls-hostgatsby-plugin-prefetch-google-fontslink-meta-previewlink-preview-generatorliverecordkaba-indexinstagram-public-apijobiak-node-commonfunctions@s0cial/node.igl-checkeriyarsius-insta.js@types/get-urlsmd-links-ory-chacon@vinzcelavi/gatsby-plugin-prefetch-google-fonts@transloadit/enrich-tweetadhubadhubserversindredashsindresorhus.jsstarhistorynode-ig-frameworkblt-translate-apipeek-linkterms-processingbetter-insta.jspolotno-pdfcdp-rawgit-fixtwitterfollowerexplorertwitterneuralnetworktweet-patchckeditor-build-fontcheck-deadlinkwhatsapp-viewerwikilogoswebuild-eventswp-continuous-deploymentvuepress-plugin-cleanmylink@yoon4027-spam/insta.jsmd-dm-linksmahastrapi-plugin-import-contentasana-taskakke-lpalexaopenfiber-botbeaker-indexosjs-browser-applicationpadexurls-mdurl-menuquest-logdetect-readme-badgeseldictator0card-images-helperembedjssee-linkshortcut-url
12.1.0

8 months ago

12.0.0

9 months ago

11.0.0

2 years ago

10.0.1

3 years ago

10.0.0

4 years ago

9.2.1

4 years ago

9.2.0

4 years ago

9.1.0

5 years ago

9.0.0

5 years ago

8.0.0

6 years ago

7.2.0

6 years ago

7.0.0

7 years ago

6.0.0

7 years ago

5.0.1

8 years ago

5.0.0

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.0.0

9 years ago

2.0.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago