staple

```javascript var staple = require("staple")({ object: { subscribe: function(target, key, callback) { target.on("change:" + key, callback); }, unsubscribe: function(target, key, callback) { target.off("change": + key, callback); }, get: funciton(target, key, value) { target.get(key, value); } set: function(target, key, value) { target.set(key, value); } } });

npm install staple
1 downloads in the last week
5 downloads in the last month
var staple = require("staple")({
  object: {
    subscribe: function(target, key, callback) {
      target.on("change:" + key, callback);
    },
    unsubscribe: function(target, key, callback) {
      target.off("change": + key, callback);
    },
    get: funciton(target, key, value) {
      target.get(key, value);
    }
    set: function(target, key, value) {
      target.set(key, value);
    }
  }
});

//mix it in with backbone events
BackboneModel.prototype.bind = function(key, to) {
  return staple.object.bind(this, key, to);
}

var item = new BackboneModel();
item.bind("location.zip", function(value) {
  console.log(value); //94102
});


//triggers the binding
item.set("location.zip", "94102"); 



//bind location.zip to another property in the model, and do it only once
item.bind("location.zip", "zip").once()

//bind location.zip to another object, and make it go both ways!
item.bind("location.zip").to(anotherModel, "location.zip").bothWays();

//chain to multiple items, and limit it!
item.bind("location.zip").to("property").to("anotherProperty").to(function(value) {

}).limit(5)

//you can even bind to values by setting a binding
anotherModel.set("location.zip", item.bind("location.zip"));

//you can also transform data as it's being bound
item.bind("name").transform(function(name) {
  return name.toUpperCase()
}).to("name2");
npm loves you