# is-same-origin

> Check if two URLs are same origin, for Node and the browser

Latest version **0.0.7** (published 2018-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-same-origin
pnpm add is-same-origin
yarn add is-same-origin
bun add is-same-origin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2018-06-03 |
| First published | 2018-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 33 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Qingrong Ke |
| Maintainers | dearke |
| Keywords | same-origin, whatwg-url |

## Links

- npm: https://www.npmjs.com/package/is-same-origin
- Repository: https://github.com/keqingrong/is-same-origin
- Homepage: https://github.com/keqingrong/is-same-origin#readme
- Issues: https://github.com/keqingrong/is-same-origin/issues
- npm.io page: https://npm.io/package/is-same-origin

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

- 0.0.7 (latest) — 2018-06-03
- 0.0.6 — 2018-06-03
- 0.0.5 — 2018-06-03
- 0.0.4 — 2018-03-26
- 0.0.3 — 2018-03-23
- 0.0.2 — 2018-03-23
- 0.0.1 — 2018-03-22

## README

# is-same-origin

[![npm version](https://img.shields.io/npm/v/is-same-origin.svg)](https://www.npmjs.com/package/is-same-origin)

> Check if two URLs are same origin, for Node and the browser

## Installation

```sh
npm install is-same-origin
```

```js
// Using ES6 modules
import isSameOrigin from 'is-same-origin';

// Using CommonJS modules
const isSameOrigin = require('is-same-origin');
```

The CDN build is also available on unpkg:

- [unpkg.com/is-same-origin/dist/index.min.js](https://unpkg.com/is-same-origin/dist/index.min.js)
- [unpkg.com/is-same-origin/dist/index-with-polyfill.min.js](https://unpkg.com/is-same-origin/dist/index-with-polyfill.min.js) - With a [URL API](https://caniuse.com/#feat=url) polyfill 

## Usage

```js
const isSameOrigin = require('is-same-origin');

isSameOrigin('http://www.example.com/dir/page.html',
  'http://www.example.com/dir/page2.html');
// => true

isSameOrigin('http://www.example.com/dir/page.html',
  'http://en.example.com/dir/other.html');
// => false
```

## License

MIT

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