12.1.0 • Published 2 years ago

get-urls v12.1.0

Weekly downloads
56,725
License
MIT
Repository
github
Last release
2 years 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-1753ig-frameworkwikilogoswp-continuous-deploymentwhatsapp-viewerstrapi-plugin-import-content@componlyco/core@daisy/books-to-videosiyarsius-insta.jsjobiak-node-commonfunctionskaba-indexl-checkerstarhistorytwitterneuralnetworktwitterfollowerexplorerterms-processingtweet-patch@artizy-io/strapi-plugin-import-content@arashgh/insta-js@androz2091/insta.js@browserstorm/runtime0card-images-helper@ber4tbey/insta.jsyunzai-micro-pluginvuepress-plugin-cleanmylinkwebuild-eventsurls-mdurl-menu@lotus-tree/requestcat@lotus-tree/saucenao@lotus-tree/fxtwitter@madhu2704/commonfunctions@mich4l/link-preview@micropub-endpoint/core@nearest/nearest-fieldlookup@el7cosmos/gatsby-plugin-prefetch-google-fonts@postr/core@s0cial/node.ig@polotno/to-vector-pdf@o/website-apppadexotzasosoep-instagramopenfiber-botosjs-browser-applicationsee-linknode-ig-frameworkpeek-linkpolotno-pdfquest-logsindredashsindresorhus.jssilly-nlpshortcut-urlgitdownhubot-apple-music-embedgun-relaysinstagram-public-apilink-meta-previewlink-preview-generatorliverecordmd-dm-linksmahamd-links-ory-chacon@worktile/theia@types/get-urls@transloadit/enrich-tweet@vinzcelavi/gatsby-plugin-prefetch-google-fonts@yoon4027-spam/insta.jsalexaakke-lpadhubadhubserverasana-taskcheck-deadlinkcdp-rawgit-fixckeditor-build-fontdetect-readme-badgesblt-translate-apibeaker-indexbetter-insta.jseldictatorembedjsfind-urls-in-objectget-urls-cliget-urls-hostgenshin-fandom-scraperget-pdf-urlsgatsby-plugin-prefetch-google-fonts
12.1.0

2 years ago

12.0.0

2 years ago

11.0.0

3 years ago

10.0.1

4 years ago

10.0.0

5 years ago

9.2.1

5 years ago

9.2.0

6 years ago

9.1.0

6 years ago

9.0.0

6 years ago

8.0.0

7 years ago

7.2.0

8 years ago

7.0.0

8 years ago

6.0.0

8 years ago

5.0.1

9 years ago

5.0.0

10 years ago

4.0.1

10 years ago

4.0.0

10 years ago

3.0.0

11 years ago

2.0.0

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago