https://github.com/msvbg/proxy-forwarder
An ES2015 Proxy that forwards every available trap to a new target.
https://github.com/msvbg/proxy-forwarder
Last synced: about 1 year ago
JSON representation
An ES2015 Proxy that forwards every available trap to a new target.
- Host: GitHub
- URL: https://github.com/msvbg/proxy-forwarder
- Owner: msvbg
- License: mit
- Created: 2016-01-29T05:27:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-29T05:36:48.000Z (over 10 years ago)
- Last Synced: 2025-04-26T08:45:03.231Z (about 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# proxy-forwarder
> An ES2015 Proxy that forwards every available trap to a new target.

`proxy-forwarder` implements all traps listed at [MDN](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Proxy) for an object, forwarding every trappable operation to a target object. Requires ES2015 Proxy support. In node, that means passing `--harmony_proxies` as a command line argument.
## Install
```
npm i --save proxy-forwarder
```
## Example
```js
import forward from 'proxy-forwarder';
let object = { x: 5 };
let mirror = forward(object);
mirror.x = 6;
assert(object.x === 6);
```
## License
MIT © Martin Svanberg