# extract-urls

> Extract urls from a string and returns an array

Latest version **1.4.1** (published 2024-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install extract-urls
pnpm add extract-urls
yarn add extract-urls
bun add extract-urls
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2024-02-19 |
| First published | 2020-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Massimiliano Ranauro |
| Maintainers | huckbit |
| Keywords | url, text, string, extract, find, scrape |

## Links

- npm: https://www.npmjs.com/package/extract-urls
- Repository: https://github.com/huckbit/extract-urls
- Homepage: https://github.com/huckbit/extract-urls#readme
- Issues: https://github.com/huckbit/extract-urls/issues
- npm.io page: https://npm.io/package/extract-urls

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.4.1 (latest) — 2024-02-19
- 1.4.0 — 2023-08-31
- 1.3.4 — 2023-04-30
- 1.3.3 — 2023-04-30
- 1.3.2 — 2020-08-31
- 1.3.1 — 2020-08-27
- 1.3.0 — 2020-08-17
- 1.2.0 — 2020-08-17
- 1.1.2 — 2020-08-15
- 1.1.0 — 2020-08-15
- 1.0.0 — 2020-08-13

## README

# extract-urls

[![npm version](https://badge.fury.io/js/extract-urls.svg)](https://badge.fury.io/js/extract-urls)

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

## To install

### npm

```sh
npm i extract-urls
```

### yarn

```sh
yarn add extract-urls
```

### unpkg

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

## Usage

```javascript
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`:

```javascript
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/](https://extracturls.huckbit.com/)

---
_Source: https://npm.io/package/extract-urls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
