Name some Built-in Globals in Node.js
Name some Built-in Globals in Node.js
In Node.js, several built-in global objects are available across all modules without the need for importing them. Here are some of the key built-in globals in Node.js:
global
: This is the global namespace object, similar to the window
object in browsers. It contains all other global objects[1][3].
process
: This object provides information about, and control over, the current Node.js process. It is an instance of EventEmitter
and includes methods to exit the process, listen to process-wide events, and get environment information[1][3].
console
: Used for printing standard outputs and errors. It provides functionalities like console.log()
, console.error()
, and console.warn()
to output information to the console[1][3][5].
Buffer
: Used to handle binary data. It can be used to create a new buffer instance which is a raw memory allocation outside the V8 heap[1][5].
setImmediate()
, clearImmediate()
: These methods are used to schedule functions to execute after the current poll phase of the event loo...
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào