Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

What are Globals in Node.js

0 votes
What are Globals in Node.js?
asked Aug 13, 2018 in Node.js by Veena Verma

2 Answers

0 votes
There are three keywords in Node.js known as Globals:-

1. Buffer – Buffer is a class in Node.js that handles binary data.
2. Global – Global represents the Global namespace object and acts as a container for all other objects.
3. Process – Process is one of the global objects but can turn a synchronous function into an async callback. It can be accessed from anywhere in code and it gives back information about application or environment.
answered Aug 14, 2018 by ranju_12 (3,740 points)
0 votes
There are following list of Node.js global objects:-

  * Console
  * Process
  * Buffer
  * __dirname
  * __filename
  * setImmediate(callback[, arg][, ...])
  * setInterval(callback, delay[, arg][, ...])
  * setTimeout(callback, delay[, arg][, ...])
  * clearImmediate(immediateObject)
  * clearInterval(intervalObject)
  * clearTimeout(timeoutObject)
answered Aug 14, 2018 by ranju_12 (3,740 points)