Rocess object, I'm talking about an object. This object contains a lot of methods and properties, and it opens a door to node. js to let our team node. js know more.
Do you know the version of node. js installed?
Do you know if your node is installed on the platform above?
Do you know the absolute path of your node executable file?
Do you want to get your ENV environment variable content?
The information you enter above can be more specific, such as Console.log (Process.env.OS).
Do you want the arguments on the command line?
OK, let's write a JS. Name Process.js
Run it on the command line:
We succeeded in getting the arguments on the command line, and for PROCESS.ARGV, the first parameter it gets is always node,
The second parameter is the path to the file, which is the parameter passed to our script starting with the third argument.
The process module provides a lot of properties and methods, such as it can return the program's return code process.exit (1), which can be used in its own function; it can also send a signal to a particular process: Process.kill (process.pid, ' SIGTERM '), where it sends the sigterm to the node process (Process.pid gets the PID number of the current node), so that your node, the process exits.
Well, I should remind you, what other methods and properties does this process have?