2.3.1 • Published 5 years ago

deprecation v2.3.1

Weekly downloads
3,248,810
License
ISC
Repository
github
Last release
5 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_sampleweb-yii2vue-v3-yandex-metrika@geeky-apo/react-native-advanced-clipboard@extrieve_technologies/quickcapture_react_native@idas1/ui-component-lib@innoswap/default-token-list@felipesimmi/react-native-datalogic-module@infinitebrahmanuniverse/nolb-deprconnex_ram00nez@kalkanisys/vue-select@hawkingnetwork/react-native-tab-view@hieuquang2212/form@hbglobal/react-native-actions-shortcuts@hemith/react-native-tnk@enkeledi/react-native-week-month-date-picker@innodata/vue-v3-ya-metrika@jellywelly/iterare@jfilipe-sparta/react-native-module_2@mgga/auth-appcustom-widgets-library@npm_fluentco/adflow-react-native-sdk@navabi/react-native-ssl-pinningdate-to-block-eth@oiti/rn-liveness2djawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarzzzxxxyyy321123native-kakao-loginnative-google-loginnew-awesome-4321react-native-tone-frameworknative-date-picker-modulenative-apple-loginnative-modal-damage-vehiclenpm_qwertynpm_one_12_34_1_npm_one_1_2_3npm_one_2_2pnm-yph-react-native-custom-componentsoryx-crm-api-requestpayutestingtest-library-123test-haptik-libtest-zeo-collecttldrawligninsemantic-release-gitmoji-actionsushi-sdk-ftmspigot-ui-inventorys3-modulescout-chatbot-widgetsmart_one_connectreact-native-arps-authorize-netreact-native-arun-ramya-testreact-native-arunjeyam1987react-native-arunmeena1987react-native-arunramya151react-native-badge-controlreact-native-bridge-packagereact-native-conekta-card-tokenizerreact-native-contact-listreact-native-bluetooth-device-detectreact-native-bubble-chartreact-native-custom-image-carouselreact-native-ctp-odpreact-native-transtracker-libraryreact-native-video-typoreact-native-version-appreact-native-volume-phisicalreact-picky-with-clear
2.3.1

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago