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-reactgenerator-bootstrap-boilerplate-templategenerator-webdesign-boilerplatejrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libjshawl-octokit-rest-no-at-signjamuskalimkhaled-salem-custom-componentsiiif-manifest-editorhong1-utilsluojia-cli-devl2forlerna@wecraftapps/react-native-use-keyboard@tlgeo/react-native-gdal@thinxviewx/core-rn@yplabs-ltd/react-native-detector@zalastax/nolb-depr@zotasys/nativeagent-get-agentawesome-module-kdastra-ufo-sdkarifbudixzarchlibrary@parallelnft/web3modal@ponchodien/react-native-printer-imin@positionex/position-sdk@petelc/learnstorybook-design-systemgenerator-yeoman-dockergenz-native-elementsframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newgaurav-react-native-loopgamification-integration-new@status-im/react-native-transparent-video@syedt/hellosdk@taingo97/react-native-awesome-module@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-expo-key-rsa-kt@taingo97/react-native-expo-rsa@taingo97/react-native-generate-key-rsa@taingo97/react-native-key-rsa@taingo97/react-native-print-xprinter@taingo97/react-native-printer-imin@taingo97/react-native-rsa@taingo97/react-native-rsa-expo@taingo97/react-native-sunmi-printer@taingo97/react-native-telpo-printerdomaincomponentdogandev-simple-toastexpo-renavigatefawaterak-online-paymentfawatrak-online-paymentfixed_form_builderfluent.adflow.reactnativesdkfluent.adflow.reactnativesdk-alphafmsl@_nomtek/react-native-shimmer-animation@abhinavoneuipoc/stencil-test@praella/localisationist@pradeepgudipati/kovaad-chat-ui-kit-styles
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

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago