暫無描述

README.md 1.4KB

deprecated NPM version Build Status Coveralls Status Dependency Status

Information

Packagedeprecated
Description Tool for deprecating things
Node Version >= 0.9

Usage

var oldfn = function(a,b) {
  return a+b;
};

// returns a new wrapper function that logs the deprecated function once
var somefn = deprecated('dont use this anymore', console.log, oldfn);

var someobj = {};

// set up a getter/set for field that logs deprecated message once
deprecated('dont use this anymore', console.log, someobj, 'a', 123);

console.log(someobj.a); // 123