# tiny-proxy

> Tiny Object proxy for Client or Server

Latest version **1.1.1** (published 2016-03-11) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2016-03-11 |
| First published | 2014-12-05 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jason Mulligan |
| Maintainers | avoidwork |
| Keywords | object, proxy |

## Links

- npm: https://www.npmjs.com/package/tiny-proxy
- Repository: https://github.com/avoidwork/tiny-proxy
- Homepage: http://avoidwork.github.io/tiny-proxy
- Issues: https://github.com/avoidwork/tiny-proxy/issues
- npm.io page: https://npm.io/package/tiny-proxy

## Recent versions

- 1.1.1 (latest) — 2016-03-11
- 1.1.0 — 2016-03-09
- 1.0.2 — 2014-12-06
- 1.0.1 — 2014-12-05
- 1.0.0 — 2014-12-05

## README

# tiny-proxy

Tiny Object proxy for Client or Server

[![build status](https://secure.travis-ci.org/avoidwork/tiny-proxy.svg)](http://travis-ci.org/avoidwork/tiny-proxy)

## API

#### proxy(obj[, readOnly = false, changeHandler])
Returns a proxy for `obj` with getters & setters, or only getters if `readOnly` is `true`.

## Example
```javascript
const proxy = require('tiny-proxy');
let original = {a: true};
let facade = proxy(original, false, function (key, oldValue, newValue) {
	console.log(key + ' was ' + oldValue + ', and is now ' + newValue);
});

facade.a = false; // a was true, and is now false
```

## Handling changes
Writable proxies will fire the `onchange` function after applying a change with the `key`, `oldValue` & `newValue` as arguments.

## License
Copyright (c) 2014 Jason Mulligan
Licensed under the BSD-3 license

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