Socket
Socket
Sign inDemoInstall

depd

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depd

Deprecate all the things


Version published
Weekly downloads
52M
decreased by-2.7%
Maintainers
1
Weekly downloads
 
Created

What is depd?

The depd package is a deprecation helper for Node.js. It allows developers to mark functions, properties, and other JavaScript features as deprecated and to issue warning messages when they are used. This can be useful for library authors who want to make changes or remove features without breaking existing code that depends on their libraries.

What are depd's main functionalities?

Deprecate functions

This feature allows you to deprecate a function by wrapping it with a deprecation warning. When the function is called, it will log a deprecation message to the console.

var deprecate = require('depd')('my-module-name');
function oldFunction() {
  deprecate('oldFunction is deprecated, use newFunction instead.');
  // old function code
}

Deprecate property access

This feature allows you to deprecate access to an object property. When the property is accessed, it will log a deprecation message to the console.

var deprecate = require('depd')('my-module-name');
var obj = {};
Object.defineProperty(obj, 'oldProperty', {
  get: function () {
    deprecate('oldProperty is deprecated, use newProperty instead.');
    return 'some value';
  }
});

Customize deprecation messages

This feature allows you to customize the deprecation message for a property to provide additional information or instructions.

var deprecate = require('depd')('my-module-name');
deprecate.property(obj, 'oldProperty', 'oldProperty is deprecated and will be removed in the next major release.');

Other packages similar to depd

Keywords

FAQs

Package last updated on 26 Oct 2018

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