# is-allowed

> Am I allowed to redirect

Latest version **1.2.0** (published 2021-01-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-allowed
pnpm add is-allowed
yarn add is-allowed
bun add is-allowed
```

## 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.2.0 |
| Published | 2021-01-01 |
| First published | 2020-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Cagatay Cali |
| Maintainers | cagataycali |
| Keywords | open, redirect |

## Links

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

## Recent versions

- 1.2.0 (latest) — 2021-01-01
- 1.0.0 — 2020-12-28

## README

# Am I Allowed To Redirect


```bash
npm i is-allowed
```

**Single domain & tld**

```javascript
const domain = "https://google.com";
const redirect = new Redirect(domain);
redirect.isAllowed("/") // true
redirect.isAllowed("/test") // true
```

**Multiple domain & tld**

```javascript
const domain = "https://google.com";
const redirect = new Redirect(domain, ['com', 'de', 'fr', 'ru']);
redirect.isAllowed("/") // true
redirect.isAllowed("https://google.ru/test") // true
```

**Also supports subdomains.**

```javascript
const domain = "https://google.com";
const redirect = new Redirect(domain, ['com', 'de', 'fr', 'ru']);
redirect.isAllowed("https://subdomain.google.ru/test") // true
```

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