2.3.1 • Published 6 years ago

deprecation v2.3.1

Weekly downloads
3,248,810
License
ISC
Repository
github
Last release
6 years ago

deprecation

Log a deprecation message with stack

build

Usage

Load deprecation directly from cdn.pika.dev

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

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

archetype-libraryeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-imageairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdkreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutils@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testluminos-ui-core@everything-registry/sub-chunk-1469jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkg@rabailriaz/hisaab-web-portalreact-native-jawwy_samplegriffin-ui-librarytest-library-123test-haptik-libwinx-form-winxwifi_configuration_packagetest-zeo-collectvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-react@cristianps1988/ds-template@cs6/react-native-test-native-view-library@con-test/react-native-concent-common@damruravihara/react-native-testing-package@corelmax/react-native-my2c2p-sdk@praella/localisationist@pradeepgudipati/kovaad-chat-ui-kit-styles@positionex/position-sdkgenerator-bootstrap-boilerplate-templategenerator-webdesign-boilerplatejrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libjshawl-octokit-rest-no-at-signjamuskalimkhaled-salem-custom-componentsjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarquickcapture_react_nativesushi-sdk-ftmrn-agora-ios-mzzzxxxyyy321123web-yii2react-native-omental-frameworkreact-native-sixdee_test_libspigot-ui-inventorytldrawlignintwine-libtwine-library@amiruldev/wajs@amirdiafi/react-native-ios-haptics@apardellass/react-native-audio-stream@arietrouw/rest@aviinash_jha/react-native-test_multiply@adobe/asset-compute-sdk@ali5049/react-native-buttons@aysea/react-native-ui-library@amblade/patswap-default-token-list@blazinaj/app-kit@buganto/client@brantalikp/rn-resize@adatechnology/react-native-android-getnet-pos@adembacaj/react-native-google-pay@_nomtek/react-native-shimmer-animation@abhinavoneuipoc/stencil-test@azalpacir/react-native-dhp-printer@denizhoxha/probotyangtao-jsyarn-react-hook-formvue-v3-yandex-metrika@parallelnft/web3modal@felipesimmi/react-native-datalogic-module@hawkingnetwork/react-native-tab-view@hbglobal/react-native-actions-shortcuts@idas1/ui-component-lib@geeky-apo/react-native-advanced-clipboard@innoswap/default-token-list@innodata/vue-v3-ya-metrika
2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago