This repository is a mirror of the component module jkroso/alias-property. It has been modified to work with NPM+Browserify. You can install it using the command npm install npmcomponent/jkroso-alias-property
. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to npmcomponent.
create robust aliases for an object's properties
$ packin add jkroso/alias-property
then in your app:
var alias = require('alias-property')
create an alias from from
to to
var obj = {a:1};
alias(obj, 'a', 'b');
obj.a; // => 1
obj.b; // => 1
obj.b = 2;
obj.a; // => 2
obj.b; // => 2
obj.a = 3;
obj.a; // => 3
obj.b; // => 3
Just run make
and navigate your browser to the test directory.