deprecation

WebJar for deprecation

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

deprecation
Last Version

Last Version

2.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

deprecation
WebJar for deprecation
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/gr2m/deprecation

Download deprecation

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/deprecation/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>deprecation</artifactId>
    <version>2.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/deprecation/
implementation 'org.webjars.npm:deprecation:2.3.1'
// https://jarcasting.com/artifacts/org.webjars.npm/deprecation/
implementation ("org.webjars.npm:deprecation:2.3.1")
'org.webjars.npm:deprecation:jar:2.3.1'
<dependency org="org.webjars.npm" name="deprecation" rev="2.3.1">
  <artifact name="deprecation" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='deprecation', version='2.3.1')
)
libraryDependencies += "org.webjars.npm" % "deprecation" % "2.3.1"
[org.webjars.npm/deprecation "2.3.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

deprecation

Log a deprecation message with stack

build

Usage

Browsers

Load deprecation directly from cdn.pika.dev

<script type="module">
  import { Deprecation } from "https://cdn.pika.dev/deprecation/v2";
</script>
Node

Install with npm install deprecation

const { Deprecation } = require("deprecation");
// or: import { Deprecation } from "deprecation";
function foo() {
  bar();
}

function bar() {
  baz();
}

function baz() {
  console.warn(new Deprecation("[my-lib] foo() is deprecated, use bar()"));
}

foo();
// { Deprecation: [my-lib] foo() is deprecated, use bar()
//     at baz (/path/to/file.js:12:15)
//     at bar (/path/to/file.js:8:3)
//     at foo (/path/to/file.js:4:3)

To log a deprecation message only once, you can use the once module.

const Deprecation = require("deprecation");
const once = require("once");

const deprecateFoo = once(console.warn);

function foo() {
  deprecateFoo(new Deprecation("[my-lib] foo() is deprecated, use bar()"));
}

foo();
foo(); // logs nothing

License

ISC

Versions

Version
2.3.1
2.0.0
1.0.1