1.1.1 • Published 2 years ago

deprecate v1.1.1

Weekly downloads
368,120
License
MIT
Repository
github
Last release
2 years ago

deprecate

Build Status

Mark a method as deprecated. Write a message to a stream the first time the deprecated method is called.

api

var deprecate = require('deprecate');

deprecate([string message1 [, string message2 ,...]])

Call deprecate within a function you are deprecating. It will spit out all the messages to the console the first time and only the first time the method is called.

var deprecate = require('deprecate');

var someDeprecatedFunction = function() {
  deprecate('someDeprecatedFunction() is deprecated');
};

someDeprecatedFunction();
someDeprecatedFunction();
someDeprecatedFunction();
console.log('end');

//program output:

WARNING!!
someDeprecatedFunction() is deprecated


end

deprecate.color

Set to false to not output a color. Defaults to '\x1b[31;1m' which is red.

deprecate.silence

Set to false to do nothing at all when the deprecate method is called. Useful in tests of the library you're deprecating things within.

deprecate.stream

The stream to which output is written. Defaults to process.stderr

license

MIT

@withonevision/join-monsterzhanshaoweiaf-webpack-devaf-webpack-zengforknode-eth-rpcnode-cas-clientnode-chaincoinnode-dcr-rpcnode-cryptomethnode-blackcoinnode-blackcoin-morenw-buildernw-builder-binnw-builder-helmacnw-builder-zeehoctocatnode-vertcoinnode-xtracoinnode-telegram-keyboard-wrappernode-litecoinnode-whitecoinnode-tacocoinnode-telegram-keyboard-wrapper-fixnw-builder-mirrornamecoinnode-mergecoinnode-absolutecoinnode-primecoinnode-darkcoinnode-guldencoinnodescape-cmdnestjs-clientnest-servernestjs-testravendbraidarstim-nodewebkit-builderwp-e2e-page-objectswpdudes-connect-casviber-botkitvibrato-loggertransledger-litecointwilio-travoltronmodbus-eventccs-cas-serverccsyunserversso@ironfly/octocat@buggyorg/graphtoolsbettertwilioav-webpack@gadgetinc/join-monster@jonyk56/mathematicsjs@s97712/join-monster@victor.accarini/ravendbbower-files@nestjs-client/common@nestjs-client/testing@nestjs/terminus@gfi-centre-ouest/docker-compose-builderee-af-webpackconnect-cas-ciconnect-cas1connect-cas2@linaframework/common@linaframework/testingdrachtio-srf@kan0315/join-monstereast-migration-progress-indicator-helpergore-gulp-litecrypsisdocker-machineexpress-openid-clientdepcheck2depcheck3gulp-rev-manifest-replacehof-form-controllerhof-form-wizardhof-template-mixinshofhof-bootstraphof-controllersjoin-monsterjoin-monster-cuzjoin-monster-icjoin-monster-nodepatchjoin-monster-nulls-lastjoin-monster-sbjoin-monster2keskoa-cas2m8serverssoloopback-rest-include-mixinkoa2-cas2mathematics-js-officialmd-nw-builder
1.1.1

2 years ago

1.1.0

3 years ago

1.0.0

5 years ago

0.1.0

8 years ago