New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

deprecated-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deprecated-js

deprecated is a function decorator that can be used to mark functions and methods as deprecated.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

deprecated

deprecated is a function decorator that can be used to mark functions and methods as deprecated. deprecated serves the same purpose as the deprecate with some differences.

Using a decorator gives you the ability to mark a function as deprecated without having to change the function's code. Simply pass a message and a function to deprecated and you get a new function that will now warn users it is deprecated when called. deprecated does not change the signature of your functions and you can continue to use them like you did before.

deprecated using console.log instead of a stream so that it can be used in node and browsers.

usage

var deprecated = require('deprecated');

function add(lhs, rhs) {
  return lhs + rhs;
}

console.log(add(1, 3));
>> 4

var deprecatedAdd = deprecated('The add function will be removed in v2.', add);

console.log(deprecatedAdd(1, 3));
>> WARNING!
>> The add function will be removed in v2.
>> 4

FAQs

Package last updated on 14 Feb 2016

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