![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Node.js - process.traceDeprecation() Method
This process.traceDeprecation() method states whether the --trace-deprecation flag is set or not on the current Node.js project. This Boolean flag controls whether the trace of deprecation warning messages are printed or not.
Syntax
process.traceDeprecation( )
Example 1
Create a file with the name "traceDeprecation.js" and copy the following code snippet. After creating the file, use the command "node traceDeprecation.js" to run this code as shown in the example below −
// process.traceDeprecation() Demo Example // Importing the process module const process = require('process'); // Printing traceDeprecation default value console.log(process.traceDeprecation);
Output 1
C:\home
ode>> node traceDeprecation.js undefined
Output 2
C:\home
ode>> node --trace-deprecation traceDeprecation.js true
Example 2
// process.traceDeprecation() Demo Example // Importing the process module const process = require('process'); // Initializing the traceDeprecation flag process.traceDeprecation = false; // Printing traceDeprecation console.log(process.traceDeprecation); // Initializing the traceDeprecation flag process.traceDeprecation = true; // Printing traceDeprecation console.log(process.traceDeprecation);
Output 1
C:\home
ode>> node traceDeprecation.js false true
Output 2
C:\home
ode>> node --trace-deprecation traceDeprecation.js true true
Advertisements