Skip to content

An ES2015 Proxy that forwards every available trap to a new target.

License

Notifications You must be signed in to change notification settings

msvbg/proxy-forwarder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxy-forwarder

An ES2015 Proxy that forwards every available trap to a new target.

Build status

proxy-forwarder implements all traps listed at MDN 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

import forward from 'proxy-forwarder';

let object = { x: 5 };
let mirror = forward(object);

mirror.x = 6;

assert(object.x === 6);

License

MIT © Martin Svanberg

About

An ES2015 Proxy that forwards every available trap to a new target.

Resources

License

Stars

Watchers

Forks

Packages

No packages published