act/pkg/runner/testdata/actions/node16/node_modules/deprecation
dependabot[bot] 3939f48e6d
build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931)
Bumps [megalinter/megalinter](https://github.com/megalinter/megalinter) from 7.1.0 to 7.2.1.
- [Release notes](https://github.com/megalinter/megalinter/releases)
- [Changelog](https://github.com/oxsecurity/megalinter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oxsecurity/megalinter/compare/v7.1.0...v7.2.1)

---
updated-dependencies:
- dependency-name: megalinter/megalinter
dependency-type: direct:production
update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-08 13:37:31 +00:00
..
dist-node build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00
dist-src build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00
dist-types build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00
dist-web build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00
LICENSE build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00
package.json build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00
README.md build(deps): bump megalinter/megalinter from 7.1.0 to 7.2.1 (#1931) 2023-08-08 13:37:31 +00:00

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