programming/node.js

[node.js] process 객체 더보기

LeeBorn 2019. 11. 25. 00:00
반응형

node.js

process 객체는 argv를 사용할 때도 쓰지만 더 많은 정보를 가지고 있다.

 

1. process.env

node의 환경설정 정보들을 볼 수 있다.

ALLUSERSPROFILE, APPDATA, CLASSPATH 등 많은 정보를 가지고 있다.

 

2. process.env.HOMEPATH

env에서 찍힌 정보들 중 선택해서 볼 수 있다.

 

3. process.versions

node에 관련된 버전 정보들을 볼 수 있다.

 

4. process.versions.node

versions 중 node의 버전을 확인할 수 있다.

 

5. process.uptime()

함수로 정의되어 있기 때문에 호출을 해줘야 한다.

node가 시작된 후 실행시간을 반환한다.

 

더 자세한 정보는 node실행 후 process를 쳐보면 정보가 나온다.

또는 아래 링크에서 확인할 수 있다.

https://nodejs.org/api/process.html

 

Process | Node.js v13.2.0 Documentation

Process# The process object is a global that provides information about, and control over, the current Node.js process. As a global, it is always available to Node.js applications without using require(). It can also be explicitly accessed using require():

nodejs.org

반응형