DeprecateJS
Example usage:
var deprecate = require('deprecatejs');
module.exports = {
oldFunc: deprecate(function (str) {
console.log(str);
}, 'Please use newFunc instead'),
newFunc: function (str) {
...
}
};
var someModule = require('someModule');
someModule.oldFunc('foo.');
In Production: (if we dont want to console error in prod we can pass in a boolean indicating if our env isProduction)
var deprecate = require('deprecatejs');
var environment = process.env.NODE_ENV;
if (environment === 'production') {
deprecate.inProduction();
}
module.exports = {
oldFunc: deprecate(function (str) {
console.log(str);
}, 'Please use newFunc instead'),
newFunc: function (str) {
...
}
};
var someModule = require('someModule ');
someModule.oldFunc('foo.');