1.4.1 • Published 3 months ago

extract-urls v1.4.1

Weekly downloads
83
License
MIT
Repository
github
Last release
3 months ago

extract-urls

npm version

Extract all urls recognizing http / https from a string and returns an array of urls.

To install

npm

npm i extract-urls

yarn

yarn add extract-urls

unpkg

<script src="https://unpkg.com/extract-urls@1.4.1/index.js"></script>

Usage

const extractUrls = require("extract-urls");

let text = `You can read https://github.com/huckbit/extract-urls or https://www.npmjs.com/package/extract-urls for more info`;
let urls = extractUrls(text);

console.log(urls);
//=> ['https://github.com/huckbit/extract-urls', 'https://www.npmjs.com/package/extract-urls']

Options

To lowercase urls use the option true:

let text = `You can read HTTPS://GITHUB.COM/HUCKBIT/EXTRACT-URLS or https://www.npmjs.com/package/extract-urls for more info`;
let urls = extractUrls(text, true);
//=> ['https://github.com/huckbit/extract-urls', 'https://www.npmjs.com/package/extract-urls']

Example application

https://extracturls.huckbit.com/

1.4.1

3 months ago

1.4.0

8 months ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago