depreca
v1.3.0
Published
Mark something as deprecated with a simple module
Downloads
698
Maintainers
Readme
Installation
Node.js
npm install depreca --save
Example
Just one method!
Deprecate function
const deprecate = require('depreca');
function foo(){
deprecate('foo() is deprecated use bar() instead');
//=> [DeprecationWarning] foo() is deprecated use bar() instead
}
Deprecate object property
const config = {
foo: 'hello',
bar: 'world'
};
deprecate(config.foo, 'foo is deprecated use bar instead');
//=> [DeprecationWarning] foo is deprecated use bar instead
// set a custom deprecation title
deprecate.title = 'MyCustomDeprecation';
deprecate(config.bar, 'bar is deprecated use foo instead');
//=> [MyCustomDeprecation] bar is deprecated use foo instead
Call only once of deprecate
deprecate.once('foo() is deprecated use bar() instead');
Changelog
You can view the changelog here
License
depreca is open-sourced software licensed under the MIT license
Author
Fabio Ricali