91-9990449935 0120-4256464 |
Node.js ProcessNode.js provides the facility to get process information such as process id, architecture, platform, version, release, uptime, upu usage etc. It can also be used to kill process, set uid, set groups, unmask etc. The process is a global object, an instance of EventEmitter, can be accessed from anywhere. Node.js Process PropertiesA list of commonly used Node.js process properties are given below.
Node.js Process Properties ExampleLet's see the simple process example to print architecture, pid, platform and version of the process. File: process_example1.js Open Node.js command prompt and run the following code: Let's see another process example to print command line arguments. Here node is considered as the first argument, filename is considered as the second argument and actual command line arguments are considered as third, fourth, fifth and so on. File: process_example2.js Open Node.js command prompt and run the following code: Node.js Process FunctionsA list of commonly used Node.js process functions are given below.
Node.js Process Functions ExampleLet's see the process example to print current working directory and uptime of the process. File: process_example3.js Open Node.js command prompt and run the following code:
Next TopicNode.js Child Process
|