duck-punch

Duck punch objects with reckless abandon

npm install duck-punch
2 downloads in the last week
4 downloads in the last month

Duck Punch

Duck punch objects with reckless abandon.

Example

var punch = require('duck-punch');

var baby = {
  poo: function(oz) {
    return 'pooped '+oz + 'oz';
  }
};

baby.poo(2);
// 'pooped 2oz'

punch(obj, 'poo', function(old, oz) {
  var old(oz) + ' of really stinky stuff';
});

obj.poo();
// 'pooped 2oz of really stinky stuff'
npm loves you