nodejs get prosses id 1

nodejs get prosses id

process.pid

Here is what the above code is Doing:
1. We’re importing the os module, which will give us access to the os.fork() function.
2. We’re printing the current process ID.
3. We’re calling os.fork(), which will return twice: once in the parent process and once in the child process.
4. We’re printing the process ID again.
5. We’re exiting the process with the exit() function.

Similar Posts