Languages
[Edit]
EN

Node.js - console.log in NodeJS

9 points
Created by:
AnnLen
13390

In this short article we would like to answer for the question: how to print in NodeJS to console?

Some developers can search: what is equivalent for JavaScript console.log() in NodeJS.

Answer:

process.stdout.write('Something to print in console ...\n');

or as reusable util:

const console = {
    log: (text) => {
        process.stdout.write(`${text}\n`);
    }
};

// Usage example:

console.log('Something to print in console ...');
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join