# isurl

> Determine whether a value is a URL instance.

Latest version **5.0.0** (published 2026-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install isurl
pnpm add isurl
yarn add isurl
bun add isurl
```

## Health

**Score 68/100 (B)** — status: active.

Positive: has types package; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-08-26 |
| First published | 2017-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/isurl) |
| Module format | ESM |
| Node | >= 22 |
| Dependencies | 3 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Steven Vachon |
| Maintainers | stevenvachon |
| Keywords | uri, url, whatwg |

## Links

- npm: https://www.npmjs.com/package/isurl
- Repository: https://github.com/stevenvachon/isurl
- Homepage: https://github.com/stevenvachon/isurl#readme
- Issues: https://github.com/stevenvachon/isurl/issues
- npm.io page: https://npm.io/package/isurl

## Dependencies (3)

- [is-object](https://npm.io/package/is-object.md) ^1.0.2
- [has-tostringtag](https://npm.io/package/has-tostringtag.md) ^1.0.2
- [is-urlsearchparams](https://npm.io/package/is-urlsearchparams.md) ^2.0.0-rc

## 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

- 5.0.0 (latest) — 2026-08-26
- 5.0.0-rc (rc) — 2026-08-15
- 4.0.2 — 2021-02-27
- 4.0.1 — 2019-04-22
- 4.0.0 — 2019-01-07
- 3.0.0 — 2019-01-07
- 2.0.0 — 2018-11-28
- 1.0.0 — 2017-06-29
- 1.0.0-alpha6 — 2017-06-16
- 1.0.0-alpha5 — 2017-04-18
- 1.0.0-alpha4 — 2017-04-09
- 1.0.0-alpha3 — 2017-03-26
- 1.0.0-alpha2 — 2017-02-24
- 1.0.0-alpha — 2017-02-21

## README

# isurl [![NPM Version][npm-image]][npm-url] ![File Size][filesize-image] ![Build Status][ghactions-image] [![Coverage Status][codecov-image]][codecov-url]

> Determine whether a value is a [`URL`](https://mdn.io/URL) instance.

Works cross-realm/iframe and despite `Symbol.toStringTag`.

> [!NOTE]
>
> If you need to support older versions of Node.js (going back to `8.x`), use `4.x` of this package.

## Install

```shell
npm install isurl
```

## Usage

### Strict

The standard.

```js
import isURL from 'isurl';

isURL('http://domain/'); //-> false
isURL(new URL('http://domain/')); //-> true
```

### Lenient

Acceptance can be extended to incomplete `URL` implementations that lack `origin`, `searchParams` and `toJSON` properties (which is common with web browsers from 2021):

```js
import isURL from 'isurl/lenient';

console.log(url.searchParams); //-> undefined

isURL(url); //-> true
```

[npm-image]: https://img.shields.io/npm/v/isurl
[npm-url]: https://npmjs.com/package/isurl
[filesize-image]: https://img.shields.io/badge/bundle-865B%20gzipped-blue.svg
[ghactions-image]: https://img.shields.io/github/actions/workflow/status/stevenvachon/isurl/test.yml
[codecov-image]: https://img.shields.io/codecov/c/github/stevenvachon/isurl
[codecov-url]: https://app.codecov.io/github/stevenvachon/isurl

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