Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deprecate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deprecate

Mark methods as deprecated and warn the user when they're called

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
165K
increased by30.32%
Maintainers
1
Weekly downloads
 
Created

What is deprecate?

The 'deprecate' npm package is used to mark functions or methods as deprecated, which means they are outdated and should not be used in future code. This is useful for developers to signal that certain parts of their codebase are obsolete and will be removed in future versions.

What are deprecate's main functionalities?

Deprecate a function

This feature allows you to mark a function as deprecated. When the function is called, a deprecation warning is logged to the console.

const deprecate = require('deprecate');

function oldFunction() {
  deprecate('oldFunction() is deprecated and will be removed in future versions.');
  // function logic
}

oldFunction();

Deprecate a method in an object

This feature allows you to mark a method within an object as deprecated. When the method is called, a deprecation warning is logged to the console.

const deprecate = require('deprecate');

const myObject = {
  oldMethod: function() {
    deprecate('myObject.oldMethod() is deprecated and will be removed in future versions.');
    // method logic
  }
};

myObject.oldMethod();

Other packages similar to deprecate

Keywords

FAQs

Package last updated on 25 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc