# is-proxy

> Checks whether a value is a proxy object

Latest version **1.0.6** (published 2021-12-24) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-12-24 |
| First published | 2020-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Max Kanaradze |
| Maintainers | null96 |
| Keywords | check, is, proxy, object, value, javascript |

## Links

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

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2021-12-24
- 1.0.5 — 2021-05-31
- 1.0.4 — 2020-04-07
- 1.0.3 — 2020-02-17
- 1.0.1 — 2020-02-13
- 1.0.0 — 2020-02-13

## README

## is-proxy

[![dependency status][deps-svg]][deps-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]

Checks whether a value is a proxy object

## Install

Install using [npm](https://www.npmjs.com/):

```sh
npm install --save is-proxy
```

or using [yarn](https://yarnpkg.com/)

```sh
yarn add is-proxy
```

## Usage

In order for this library to track when a Proxy object is created, it has to either mutate global Proxy constructor or enforce usage of its own Proxy constructor.

#### Assigning Proxy to the global object

> Note: In this case you **must** include this library at the top of your entry point, so it can pick up Proxy creation properly.

```js
// At the top of your entry point
import 'is-proxy';

// Later
import { isProxy } from 'is-proxy';

const myProxy = new Proxy({}, {});
const myRevocableProxy = Proxy.revocable({}, {});

isProxy(myProxy); // ~> true
isProxy(myRevocableProxy.proxy); // ~> true
```

#### Without global namespace pollution

```js
import { isProxy, Proxy } from 'is-proxy/pure';

const myProxy = new Proxy({}, {});
const myRevocableProxy = Proxy.revocable({}, {});

isProxy(myProxy); // ~> true
isProxy(myRevocableProxy.proxy); // ~> true
```

## API

##### Available in `is-proxy` and `is-proxy/pure`:

_isProxy(o: any): boolean_ - returns true if `o` is a proxy object, false if it is not.

##### Available in `is-proxy/pure`:

_Proxy_ - JavaScript [`Proxy`][proxy-url], with proxy creation tracking.

### Author

**Max Kanaradze**

[GitHub Profile](https://github.com/maxk096)

### MIT Licensed

[deps-svg]: http://david-dm.org/inspect-js/is-proxy/status.svg
[deps-url]: http://david-dm.org/inspect-js/is-proxy
[license-image]: http://img.shields.io/npm/l/is-proxy.svg
[license-url]: LICENSE
[downloads-url]: http://npm-stat.com/charts.html?package=is-proxy
[proxy-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
[downloads-image]: https://img.shields.io/npm/dm/is-proxy

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